If you're trying to set something up with the public Mastodon API, you might need your account ID. This is one of the ways you can find your ID.
You can find your mastodon account ID by doing a call to the following URL.
Replace INSTANCE
with the name of the server you are on. If you're on mastodon.online for example, it will be mastodon.online
.
Replace USERNAME
with your username.
https://INSTANCE/api/v1/accounts/lookup?acct=USERNAME
Now you can either visit that URL in the browser, or use curl in your terminal:
curl https://INSTANCE/api/v1/accounts/lookup?acct=USERNAME
Both will return an object holding your id
.
{
"id": "1",
"username": "fakename",
"acct": "fakename",
"display_name": "A fake name",
"locked": false
// ...
}
If you want to know more about this endpoint. Check out the documentation. Hopefully this can help people to quickly find their account ID.
Top comments (1)
Nice!
Couple of things to note:
/api/v1/accounts/verify_credentials
method, but you need to use a Bearer token when calling that endpoint.