Instagram location API: mining posts by place
Locations are Instagram's underrated dimension: every geotagged post carries a place id, and every place id is a filter the platform curated itself. For local research — venues, neighborhoods, events — location mining beats keyword search on precision.
The two endpoints
GET /v1/ig/location/info/{pk} # place card
GET /v1/ig/location/media/{pk} # posts at the place, paginated
The location card returns name, address, coordinates and the media count — everything needed to verify you have the right place among same-named venues:
from getsocialapi import Client
ig = Client(api_key="gsa_live_...").instagram
loc = ig.location_info(pk)
print(loc["name"], loc.get("lat"), loc.get("lng"), loc.get("media_count"))
Walking the media
The location media route is
native-page paginated: pass next_max_id back as max_id while it is
returned. Items are the standard media shape — captions, counters,
owners, timestamps.
posts, cursor = [], None
while True:
page = ig.location_media(pk, max_id=cursor)
posts += page["items"]
cursor = page.get("next_max_id")
if not cursor or len(posts) >= 500:
break
One trap: the response also carries a next_page counter. It is a
page number, not a cursor — using it as max_id returns Invalid
Cursor. next_max_id or bust.
Where place ids come from
- Media items themselves: every geotagged post from user media or hashtag posts carries its location id in the payload.
- The venue's own Instagram profile often pins its place.
Harvest ids from any media stream you already collect, dedupe, then expand each into its own post set.
What location datasets answer
| Question | Method |
|---|---|
| Footfall proxy | post volume per time bucket from taken_at |
| Venue popularity trend | media count + ER over rolling windows |
| Event detection | volume spikes vs baseline at a place |
| Local creator discovery | owners recurring across a place's posts |
| Competitive set | same-category venues within radius, via coordinates |
Coordinates in the location card make radius queries trivial — harvest cards for all candidate venues, filter by haversine distance, then walk only the ones inside your fence.
Scale notes
A venue with 50k geotagged posts is ~2 500 pages at native size — checkpoint the cursor per location and resume across sessions (see the rate limits guide). For dense city-center research, sample by time window instead of full walks: the goal is usually the distribution, not the census.
Place ids in, posts out — getsocialapi.com, first 100 calls free.
Build with GetSocialAPI
Explore Instagram API for capabilities, pricing and integration examples. Create an account to start with 100 free calls, or follow the quickstart.