To get your Account ID in TMDB API, follow these steps:
1. Sign in to TMDB
2. Request a token
GET https://api.themoviedb.org/3/authentication/token/new?api_key=YOUR_API_KEY
3. Authenticate the request token
Before creating your session, you must authenticate your token.
https://www.themoviedb.org/authenticate/your_request_token
4. Create a new session id
Once the request token is authenticated, exchange it for a session ID. Read more here
POST https://api.themoviedb.org/3/authentication/session/new?api_key=YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"request_token": "YOUR_REQUEST_TOKEN"}'
5. Fetch Your Account ID
Once you have a session ID, use this request to generate your account id:
GET "https://api.themoviedb.org/3/account?api_key=YOUR_API_KEY&session_id=YOUR_SESSION_ID"
Response
{
"avatar": {
"gravatar": {
"hash": "374b042c3cf5a753197e33390a88137b"
},
"tmdb": {
"avatar_path": null
}
},
"id": 13974313,
"iso_639_1": "en",
"iso_3166_1": "NG",
"name": "",
"include_adult": false,
"username": "bisi"
}
The account ID is “id”: 13974313. You will use this ID for account-related operations.