API DocsinstagramContentGet location posts
Get location posts
What this API is for
- Get Instagram location-related posts
- Support sorting by top or latest
- Location ID can be obtained from search API (search_places) or post details
GET
/openapi/api/v1/instagram/v3/get_location_postsPrice:Price unavailable · Actual charges depend on free quota and account discounts
Authentication
All API requests require a Bearer project token in the Authorization header
Authorization header
Authorization: Bearer YOUR_API_TOKENRequest parameters
- location_id: Location ID (numeric)
- tab: Post sort order
- ranked: Top posts (default)
- recent: Latest posts
- first: Posts per page (default 12, max 50)
- after: Pagination cursor from previous response page_info.end_cursor
- page_size_override: Posts per page (default 12)
| Name | Location / type | Required | Notes | Example |
|---|---|---|---|---|
| location_id | query / string | Yes |
| 1016248898 |
| tab | query / string | No |
| |
| first | query / integer | No |
| |
| after | query / string | No |
| |
| page_size_override | query / integer | No |
|
Request examples
curl -X GET "https://api.trmesh.com/openapi/api/v1/instagram/v3/get_location_posts" \ -H "Authorization: Bearer sdc_your_project_token" \ -H "Accept: application/json"
Response fields
- data.sections: Post section list
- layout_content.medias: Media list
- media.id: Post ID
- media.code: Post shortcode
- media.media_type: Media type (1=image, 2=video, 8=carousel)
- media.like_count: Likes count
- media.comment_count: Comments count
- media.caption.text: Post caption text
- media.user: Publisher info
- data.next_max_id: Next page cursor
- data.next_page: Next page info
- data.more_available: Whether has more content
| Field | Type | Notes | Example |
|---|---|---|---|
| data.sections | unknown |
| |
| layout_content.medias | unknown |
| |
| media.id | unknown |
| |
| media.code | unknown |
| |
| media.media_type | unknown |
| |
| media.like_count | unknown |
| |
| media.comment_count | unknown |
| |
| media.caption.text | unknown |
| |
| media.user | unknown |
| |
| data.next_max_id | unknown |
| |
| data.next_page | unknown |
| |
| data.more_available | unknown |
|
Common response envelope
Common fields for response status, request identifiers and data
| Field | Type | Notes | Example |
|---|---|---|---|
| code | integer |
| |
| request_id | string | null |
| |
| message | string |
| |
| message_zh | string |
| |
| support | string |
| |
| time | string |
| |
| time_stamp | integer |
| |
| time_zone | string |
| |
| docs | string | null |
| |
| cache_message | string | null |
| |
| cache_message_zh | string | null |
| |
| cache_url | string | null |
| |
| router | string |
| |
| params | unknown |
| |
| data | unknown | null |
|
Errors and limits
The docs cover not only success responses, but also auth failures, rate limits, and data-service errors
| Code | Meaning | Notes |
|---|---|---|
| 200 | Success | The request completed and returned the standard response envelope. |
| 401 | Unauthorized | The token is missing, invalid, or no longer active. |
| 429 | Rate limited | The request exceeded token, user, or plan-level throughput limits. |
| 502 | Service unavailable | The gateway could not obtain a healthy result. Retry in a moment. |
Next steps
New to the API? Read the guide or explore examples