Skip to main content

Instagram location posts API

GET /ig/location/media/{pk} · base https://api.getsocialapi.com/v1

Public media tagged at a location, paginated.

Request​

ParameterInRequiredDescription
pkpathyesNumeric location id (from location info)
max_idquerynoCursor from the next_max_id field of the previous page

The native page size is defined by the service; a page-size parameter is not supported here — use max_id to paginate.

Example​

curl "https://api.getsocialapi.com/v1/ig/location/media/213145014" \
-H "X-API-Key: gsa_live_..."

Response​

{
"sections": [
{
"layout_type": "media_grid",
"feed_type": "media",
"layout_content": {
"medias": [
{ "media": { "pk": "...", "code": "...", "taken_at": 1760112000, "media_type": 1, "user": {} } }
]
},
"explore_item_info": { "num_columns": 3, "total_num_columns": 3 }
}
],
"next_max_id": "...",
"more_available": true,
"auto_load_more_enabled": true,
"status": "ok"
}
FieldTypeDescription
sections[]arrayGrid sections; each wraps a batch of medias
sections[].layout_typestringmedia_grid (photos), two_by_two_item (tiles)
sections[].layout_content.medias[].mediaobjectFull media object — same shape as in user medias
next_max_idstringCursor for the next page — pass it back as max_id; absent/null on the last page
next_pagenumberPage counter returned by Instagram (not a cursor; 0 when there is no next page)
more_availableboolWhether more pages exist

Pagination​

Pass next_max_id as max_id until more_available is false. Flatten sections[].layout_content.medias[].media to get a plain media list; deduplicate by pk when aggregating pages.

Errors​

HTTPMeaning
401 / 403 / 429see Rate limits
404location does not exist