# Instagram Locations in a city API (instagram.city_locations)

- Canonical page: [https://everyinfra.com/en/instagram-api/city_locations](https://everyinfra.com/en/instagram-api/city_locations?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "instagram", "action": "city_locations", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of 96 per call (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=instagram&action=city_locations

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| city_id | not declared | yes | not declared | A city ID from `location_cities` (c followed by digits, such as `c2728325`), or a city page link. |
| page_token | not declared | no | not declared | Page token for `city_locations`. Leave it out for the first page, then pass back the previous response's `next_page_token` exactly as received, keeping the other inputs unchanged. Tokens last 24 hours and each page is one call; the last page has no `next_page_token`. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | Position from 1: the order of this row within this result. user_search: first the accounts returned by Instagram's search box (matched_by is search_box), in the search box's order; then the authors of posts found with this keyword, added to fill up the count (matched_by is post_author); results without matched_by carry the position at which Instagram ranks the account for this keyword. similar_profiles: the account's place among the similar accounts, ordered by followers. likers: the account's place in the list of likers. |
| location_id | Location ID. Pass it to location_info, location_nearby or location_posts. |
| name | Name of the object itself, for account, product and business capabilities. |
| slug | The name part of the Instagram location directory link, such as st-patricks-cathedral. |
| url | Link to the record on the platform. |
| city_id | City ID, c followed by digits, such as c2728325. Pass it to city_locations. |
| city_name | (city_locations) The city's name in Instagram's location directory, the same on every row. |
| country_code | Two-letter country code (ISO 3166-1), such as US. |
| country_name | Country name in English, such as United States. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "instagram",
  "action": "city_locations",
  "params": {
    "city_id": "c2728325"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "instagram",
        "action": "city_locations",
        "params": {
            "city_id": "c2728325",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:18:47Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 96. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "instagram",
  "action": "city_locations",
  "results": [
    {
      "rank": 1,
      "location_id": "3000346",
      "name": "St. Patrick's Cathedral",
      "slug": "st-patricks-cathedral",
      "url": "https://www.instagram.com/explore/locations/3000346/st-patricks-cathedral/",
      "city_id": "c2728325",
      "city_name": "MidtownEast",
      "country_code": "US",
      "country_name": "United States",
      "platform": "instagram"
    },
    {
      "rank": 2,
      "location_id": "1176464239075912",
      "name": "New York City - Manhattan - Nyc",
      "slug": "new-york-city-manhattan-nyc",
      "url": "https://www.instagram.com/explore/locations/1176464239075912/new-york-city-manhattan-nyc/",
      "city_id": "c2728325",
      "city_name": "MidtownEast",
      "country_code": "US",
      "country_name": "United States",
      "platform": "instagram"
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 96,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=instagram
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
