DEV Community

Intropix-team
Intropix-team

Posted on AI-assisted

How do you map where a brand's Instagram posts were taken? (venue and coordinates to GeoJSON)

An event brand wanted to see its own footprint for September: which venues it posted from, and whether those posts did better than the rest. Instagram shows the location tag one post at a time, under the handle. We wanted all of them as points on a map.

How we solved it

We built the PRO Instagram Posts & Reels Scraper on Apify (disclosure: it's ours). Every post carries location_name, location_id, location_city, location_lat and location_lng, null when there is no tag, and it needs no Instagram login. One brand, one month:

{
  "usernames": ["redbull"],
  "maxPosts": 200,
  "sinceDate": "2026-09-01",
  "untilDate": "2026-09-30"
}
Enter fullscreen mode Exit fullscreen mode

The date window decides what comes back; maxPosts is only a ceiling. Then the located posts become GeoJSON, which opens in QGIS, kepler.gl or geojson.io. Note the longitude, latitude order:

import json
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("intropix/instagram-posts-reels-scraper-pro").call(run_input={
    "usernames": ["redbull"], "maxPosts": 200,
    "sinceDate": "2026-09-01", "untilDate": "2026-09-30"})
posts = list(client.dataset(run["defaultDatasetId"]).iterate_items())

features = [{
    "type": "Feature",
    "geometry": {"type": "Point",
                 "coordinates": [p["location_lng"], p["location_lat"]]},
    "properties": {"venue": p["location_name"], "post": p["permalink"],
                   "likes": p["like_count"], "views": p["view_count"]},
} for p in posts if p["location_lat"] is not None]

with open("locations.geojson", "w") as f:
    json.dump({"type": "FeatureCollection", "features": features}, f)
print(len(features), "of", len(posts), "posts carry a location")
Enter fullscreen mode Exit fullscreen mode

What came out

A real Red Bull reel from 17-10-2026, with the location fields:

{
  "permalink": "https://www.instagram.com/p/DekxytFz6gm/",
  "post_type": "reel",
  "view_count": 1588744,
  "location_name": "Cypress Mountain",
  "location_id": "415790",
  "location_city": null,
  "location_lat": 49.39541,
  "location_lng": -123.20219
}
Enter fullscreen mode Exit fullscreen mode

Note the null city next to real coordinates. That is normal, so we plot from the coordinates and treat the city as a label. For one marker per venue, group on location_id, not the name, since venue names are not unique.

Cost

A month with 100 posts is $0.005 + $0.002 + 100 x $0.0039 = $0.397. Posts without a location are billed too; there is no "located only" filter.

The caveat

Only tagged posts have a location, and it is the venue the publisher picked, not where the camera was. A city-wide tag is one point for the whole city. Keep this at brand and venue level: our Terms prohibit using location data to infer where a person is.

To try it without code, the Map where a brand's Instagram posts were taken task runs the PRO Instagram Posts & Reels Scraper on one account. If captions, likes, comments, views and dates are all you need, without the location fields, the standard Instagram Posts & Reels Scraper returns those at $1.90 per 1,000 posts.

Field list, pricing and n8n or MCP setup are in the PRO actor overview.

Top comments (0)