usernamestringwajib
Instagram username
https://api.sandbase.ai/v1/api/instagram/v3/user-id-by-usernameConvert an Instagram username into its numeric user ID, the internal identifier needed by most Instagram profile, posts and followers APIs.
[
{
"data": {
"user_id": "1821100851"
}
}
]Pilih contoh untuk memuat input dan hasilnya ke playground.
Look up the numeric user ID (pk) of an Instagram account from its username. The ID stays the same when the account changes its username, so it is the safer key to store.
| Username | User ID | |
|---|---|---|
| Example | nasa | 528817151 |
| Changes when the account renames | Yes | No |
| Where you find it | Profile URL, bio, mentions | Not shown on the profile; returned by APIs |
| Accepted by | User profile, User posts, User reels, followers and following | Similar users, User brief |
Use the username for one-off requests, since most Instagram APIs here accept it directly. Save the user ID next to it when you track accounts over time. If a request by username starts failing, look the stored ID up with Instagram ID to Username to find the new name. The Instagram ID lookup guide covers both directions.
curl -X POST "https://api.sandbase.ai/v1/api/instagram/v3/user-id-by-username" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"username": "nasa"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Instagram username |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"user_id": "528817151"
}
| Field | Meaning |
|---|---|
user_id | Numeric user ID as a string. |
@. Usernames that do not exist fail and are not charged.$0.008 per successful call. Failed calls, including lookups whose target does not exist, are not charged. It is included in the daily free quota of each organization.
Mulai membangun
Endpoint API platform dengan autentikasi dan pelacakan penggunaan terpadu.
curl -X POST "https://api.sandbase.ai/v1/api/instagram/v3/user-id-by-username" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"username": "nima.vahed"
}'Atur SandBase API key Anda di environment server Anda. Permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key Anda di server. Jangan tampilkan di kode browser.
usernamestringwajibInstagram username
Contoh respons yang disimpan untuk API ini; tidak ada permintaan langsung yang dibuat saat melihatnya.
[
{
"data": {
"user_id": "1821100851"
}
}
]Jelajahi lebih lanjut
| API | Harga | Respons |
|---|---|---|
Instagram User ID LookupAPI ini Instagram | $0.008 per panggilan | JSON |
Instagram | $0.008 per panggilan | JSON |
Instagram | $0.008 per panggilan | JSON |
Instagram | $0.008 per panggilan | JSON |
Instagram | $0.002 per panggilan | JSON |
Instagram | $0.008 per panggilan | JSON |
Panduan:Instagram API cost: official limits and per-call pricesBest Instagram API in 2026: Pricing Compared
Pertanyaan
Kirim permintaan POST ke https://api.sandbase.ai/v1/api/instagram/v3/user-id-by-username dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.
$0.008 per panggilan. Setiap organisasi mendapat 100 panggilan gratis per hari UTC, dibagi di seluruh API SandBase yang memenuhi syarat termasuk yang ini; setelah itu setiap panggilan ditagihkan dengan harga ini dari saldo SandBase Anda. Tidak ada langganan.
Wajib: username (string). Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.
Respons JSON yang dikembalikan dalam permintaan HTTP yang sama (sinkron). README di halaman ini menyertakan contoh respons.
Tidak. Instagram User ID Lookup berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API Instagram secara terpisah.