usernamestringобязательно
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"
}
}
]Выберите пример, чтобы загрузить его входные данные и результат в 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.
Начните разработку
Конечная точка платформенного API с единообразной аутентификацией и учётом использования.
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"
}'Укажите свой ключ SandBase API в окружении сервера. Запросы используют аутентификацию Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Храните ключ на сервере. Не раскрывайте его в коде браузера.
usernamestringобязательноInstagram username
Сохранённый пример ответа для этого API; при просмотре живой запрос не выполняется.
[
{
"data": {
"user_id": "1821100851"
}
}
]Посмотреть больше
| API | Цена | Ответ |
|---|---|---|
Instagram User ID LookupЭтот API Instagram | $0.008 за запрос | JSON |
Instagram | $0.008 за запрос | JSON |
Instagram | $0.008 за запрос | JSON |
Instagram | $0.008 за запрос | JSON |
Instagram | $0.002 за запрос | JSON |
Instagram | $0.008 за запрос | JSON |
Руководства:Instagram API cost: official limits and per-call pricesBest Instagram API in 2026: Pricing Compared
Вопросы
Отправьте POST-запрос на https://api.sandbase.ai/v1/api/instagram/v3/user-id-by-username, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.
$0.008 за вызов. Каждой организации предоставляется 100 бесплатных вызовов в сутки по UTC, общих для всех подходящих API SandBase, включая этот; после этого каждый вызов тарифицируется по этой цене и списывается с баланса SandBase. Подписка не требуется.
Обязательные: username (string). В таблице Parameters и в Playground на этой странице перечислены все поля.
JSON-ответ, возвращаемый в том же HTTP-запросе (синхронно). В README на этой странице приведен пример ответа.
Нет. Instagram User ID Lookup работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API Instagram.