How to list Instagram posts tagged at a location
Get public Instagram posts tagged at a location with captions, authors, engagement counts, and a cursor for the next page
On this page
You have one storefront locationId and need the first page of public Instagram posts tagged there, then a short read of up to five posts to decide whether to launch a geotagged campaign or adjust opening-week content
The deliverable is a table with one row per post and a theme column you add after reading the captions. No run has been executed for this article. Values here are placeholders showing the shape
If your target is a hashtag rather than a place, the companion guide on latest Instagram posts for a hashtag covers that list
Example input and worksheet design
Example input
| Field | Value |
|---|---|
locationId | 17895678901234567 |
sort | recent |
The worksheet has these columns. Theme is written by the reader, not returned by the tool
| author | caption | mediaType | likes | comments | createdUtc | url | theme |
|---|---|---|---|---|---|---|---|
| (username) | (caption text) | photo, video or carousel | (count) | (count) | (epoch seconds) | (post URL) | (your label) |
Keep the table to the first page for the first pass. Five rows are enough for the campaign decision described above
Inputs the tool takes
The contract documents three inputs for anyapi.instagram.location_posts
locationIdis required.sortis optional. It takesrankedorrecent, and defaults toranked.cursoris optional. It takes thenextCursorvalue from a previous response.
The tool is called through POST /v1/runs with toolId anyapi.instagram.location_posts
Step 1: fetch the first page
Call the tool once with your locationId. Add "sort": "recent" when you want newest first, or leave it out to use Instagram's top ranking
Cursor paging is the limit to plan around. data.nextCursor is an opaque cursor for the next page, or null when there are no more posts. Pass it back as cursor to continue, and expect one call per page. A three-page scan is three calls, so decide the page count before you start
The response has a found field. When found is false, reason is present and is not_found: the source states the target does not exist, or returned nothing for it. A found: false answer is a successful call, not an error, and costUsd is what it actually cost. Stop there and check the location id
Reading the post fields
data.posts holds the public posts tagged at the location, and each row carries the fields below. The required fields are id, url, author, caption, likes, comments and createdUtc
authoris the username without the initial @.authorPrivatesays whether that account is private, andauthorVerifiedsays whether it carries Instagram's verified badge.captionis the caption text.captionEditedsays whether it changed after posting.hashtagsandmentionslist what the caption carries, with the initial # or @ kept.mediaTypeis photo, video or carousel.carouselCountappears on carousel posts only.likesandcommentsare counts.countsHiddensays whether the author hid the like and view counts, so a zero is not a measure of engagement when that flag is true.createdUtcis a UTC epoch timestamp in seconds. Multiply by 1000 for a JS Date in milliseconds.urlis the canonical post URL, andshortcodeis the segment Instagram puts in that URL.paidPartnershipsays whether the post is tagged as a paid partnership. Use it to separate organic local posts from ads before you call the buzz local.locationName,locationLatandlocationLngdescribe the tagged location.
Fill the theme column only after reading the caption. Group the five posts into one or two themes and write the theme in plain words, for example "opening week queue" or "product close-ups". The tool does not return a theme
The agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to list public
Instagram posts tagged at one location. Check the current inputs and
price of anyapi.instagram.location_posts before running anything. Call
it once with locationId 17895678901234567 and sort recent. Summarize up
to five returned captions into one theme each, and return a table with
author, caption, mediaType, likes, comments, createdUtc, url and theme.
If found is false, report the reason and stop. If nextCursor is not
null, report it but do not fetch another page.Replace the example id with your own before the run. If you want the newest posts, keep sort on recent; drop it to use ranked order
Estimated tool cost
Prices read from the Purrkey catalog on November 13, 2026. The listing is max_call, which the catalog defines as "Maximum per call. Successful runs settle at the actual AnyAPI charge." Totals below are ceilings
| Step | Formula | Unit price | Planned quantity | Total |
|---|---|---|---|---|
| Single location page | calls x max price | $0.0012 per call | 1 | $0.0012 |
| Three-page scan | calls x max price | $0.0012 per call | 3 | $0.0036 |
Model fees for the agent are not counted. A three-page scan also means three nextCursor handoffs, so a failed page costs a call like any other
Run the first page
Open the tool page, confirm the current price and inputs, and call it once for your storefront: anyapi.instagram.location_posts
Get started by giving this to your agent
- Claude Code
- Codex
- Gemini CLI
- Cursor
- GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with Instagram.FAQ
How do I list Instagram posts tagged at a location?
Call anyapi.instagram.location_posts with a locationId from instagram.search_locations. Add sort recent for newest first, or leave it out for ranked order.
What inputs does anyapi.instagram.location_posts take?
It takes locationId, which is required, sort, which accepts ranked or recent and defaults to ranked, and cursor, which comes from a previous response's nextCursor.
What does nextCursor mean in the response?
nextCursor is an opaque cursor for the next page of posts, or null when there are no more posts. Pass it back as cursor to continue.
How much does it cost to list Instagram location posts?
One page costs at most $0.0012 and a three-page scan at most $0.0036. The listing is max_call, so those totals are ceilings.
What happens when the location has no posts?
The tool returns found false with reason not_found when the source states the target does not exist or returned nothing for it. That is a successful call, not an error, and costUsd is what it actually cost.
Can I see likes and comments on location posts?
likes and comments are returned, but countsHidden says whether the author hid the like and view counts. When that flag is true, a zero is not a measure of engagement.
Next step
Try this with Instagram
The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.