Get Mastodon Account ID from Username


Note: Every Mastodon has an RSS feed you can use to get statuses if you don't need the data in JSON format

If you want to get a user's statuses from Mastodon you can't just look these up with the username. You need, to quote the documentation, "the ID of the Account in the database". To get this, we can use the lookup endpoint that will return what we need:

# for an account on

# also works for remote accounts

Assuming the username is valid, you will receive a response like this:

"id": "1234567891011121314",
"acct": "foobar",
"username": "foobar"
// ...

Then you can use that ID to make a request for a users statuses:

curl https://example.instance/api/v1/accounts/1234567891011121314/statuses