用户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 用户
用户ID转用户信息
通过Instagram用户ID获取用户信息 可用于将用户ID转换为用户名及获取完整用户资料
GET
/
v1
/
instagram
/
user_id_to_username
用户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 credits每次请求
复制给 AI
🤖 为什么还要自己写代码?
让 AI 来处理重复工作。点击按钮即可复制一段整理好的提示词,用于 ChatGPT、Claude 或你常用的 AI 助手。
授权
接口鉴权凭证。请在请求 Header 中传入 Authorization: Bearer <YOUR_API_KEY>。
可在 Dashboard 获取你的 API Key。
响应
请求成功
The response is of type object.

