Get user info by user ID
curl --request GET \
--url https://api.keyapi.ai/v1/instagram/user_id_to_username \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keyapi.ai/v1/instagram/user_id_to_username"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keyapi.ai/v1/instagram/user_id_to_username', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.keyapi.ai/v1/instagram/user_id_to_username")
.header("Authorization", "Bearer <token>")
.asString();{
"code": 0,
"message": "success",
"data": {
"strong_id__": "18527",
"pk": "18527",
"highlights_tray_type": "DEFAULT",
"id": "18527",
"profile_pic_url": "https://scontent-ord5-2.cdninstagram.com/v/t51.2885-19/460170653_852233457013406_8133149038171915885_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=102&_nc_oc=Q6cZ2QGeOeZ0egfhF9f1dMHH3FKxU2K9qMgkcflUK5CTbCN2ig9KaNvRQllD6Mb-H0nNtIc&_nc_ohc=SMQ29bnLUloQ7kNvwF3wV4E&_nc_gid=37-yAcP-0rjBVfkBSkGTbQ&edm=AEF8tYYBAAAA&ccb=7-5&oh=00_Afzvd5uAMDRo3QJL9NANzZNaWrtVdc_hUk27DW9YPNecpQ&oe=69ADBA3F&_nc_sid=1e20d2",
"username": "javan",
"show_ig_app_switcher_badge": false
},
"requestId": "ea456b11-c64d-4c29-bd4f-fad4e67a6c8c"
}{
"code": 400,
"data": null,
"message": "Missing required parameter: handle"
}{
"code": 401,
"data": null,
"message": "apiKey is null"
}{
"code": 402,
"data": null,
"message": "apiKey quota is not enough"
}{
"code": 429,
"data": null,
"message": "qps limit exceeded"
}{
"code": 500,
"data": null,
"message": "Internal server error"
}Instagram User
Get user info by user ID
Get user information by Instagram user ID. Useful for converting a user ID to a username or retrieving detailed user data.
GET
/
v1
/
instagram
/
user_id_to_username
Get user info by user ID
curl --request GET \
--url https://api.keyapi.ai/v1/instagram/user_id_to_username \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keyapi.ai/v1/instagram/user_id_to_username"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keyapi.ai/v1/instagram/user_id_to_username', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api.keyapi.ai/v1/instagram/user_id_to_username")
.header("Authorization", "Bearer <token>")
.asString();{
"code": 0,
"message": "success",
"data": {
"strong_id__": "18527",
"pk": "18527",
"highlights_tray_type": "DEFAULT",
"id": "18527",
"profile_pic_url": "https://scontent-ord5-2.cdninstagram.com/v/t51.2885-19/460170653_852233457013406_8133149038171915885_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-ord5-2.cdninstagram.com&_nc_cat=102&_nc_oc=Q6cZ2QGeOeZ0egfhF9f1dMHH3FKxU2K9qMgkcflUK5CTbCN2ig9KaNvRQllD6Mb-H0nNtIc&_nc_ohc=SMQ29bnLUloQ7kNvwF3wV4E&_nc_gid=37-yAcP-0rjBVfkBSkGTbQ&edm=AEF8tYYBAAAA&ccb=7-5&oh=00_Afzvd5uAMDRo3QJL9NANzZNaWrtVdc_hUk27DW9YPNecpQ&oe=69ADBA3F&_nc_sid=1e20d2",
"username": "javan",
"show_ig_app_switcher_badge": false
},
"requestId": "ea456b11-c64d-4c29-bd4f-fad4e67a6c8c"
}{
"code": 400,
"data": null,
"message": "Missing required parameter: handle"
}{
"code": 401,
"data": null,
"message": "apiKey is null"
}{
"code": 402,
"data": null,
"message": "apiKey quota is not enough"
}{
"code": 429,
"data": null,
"message": "qps limit exceeded"
}{
"code": 500,
"data": null,
"message": "Internal server error"
}🪙2 creditsper request
Copy for AI
🤖 Why Code When AI Can Do It For You?
Stop writing code like it’s 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.
Authorizations
API key for authentication. Format: sk_live_xxxxxxxxxxxxx
Get your API key from the Dashboard.
Response
The response is of type object.

