I run a visa agency in Bali, and the other half of my week goes into Apify Actors. One of them takes Instagram handles and returns one row per post: author, caption, likes, comments, play count, media link, location — plus two convenience fields parsed out of the caption, hashtags and mentions.

Those two are the fields buyers actually filter and group on — nobody pivots a spreadsheet on a 2,000-character caption. Which is exactly why I had never checked them. A derived column looks finished the moment it is not empty.

The panel

Four pages of posts each from natgeo, nike, nasa, disneyplus, jimmychin and natgeotravel, read on 16 November 2026: 281 distinct posts — not handpicked oddities, just the newest posts of six large accounts. Across them the caption regex produced 307 mention values on 159 posts.

53 of the 307 are not usernames

Sorted by how often they appeared:

Value in mentions Posts
hulu. 15
rolex. 12
disneyplus. 6
joelsartore. 3
natgeotv. 2
15 more, once each 15

Twenty distinct values, 53 occurrences, 39 of the 281 posts affected.

Every one of them ends in a period, and the reason is boring: the mention ended a sentence. …now streaming on @DisneyPlus and @Hulu. The caption parser takes a run of characters that are legal in an Instagram username, and a period is legal in one — natgeo.travel would be a perfectly good handle — so you cannot simply drop periods from the character class.

What you can do is check the other end of the rule. I asked the upstream Instagram source to resolve all 20 values, then the same 20 with the trailing period removed:

GET /v1/user/by/username?username=hulu. 400 {"detail":"Invalid username: 'hulu.'","exc_type":"ValidationError"} GET /v1/user/by/username?username=hulu 200 {"username":"hulu","pk":191074609,"follower_count":3285081,…} 

20 of 20 rejected as invalid. 20 of 20 alive once the period came off. An Instagram username may contain periods but may not end with one, and that single rule covers every broken value in the sample.

There is also a quieter version of the same bug. In four posts the stripped name was also in the list on its own:

"mentions": ["joelsartore", "joelsartore.", "sanantoniozoo."] 

One account, two rows in your group-by. Anyone counting "how many posts mention @joelsartore" gets the right answer and the wrong total in the same query.

The trap in the obvious fix

The obvious fix is "strip trailing punctuation". Do not. The same sample contains camhicks_ and kevinpages_, which look equally mangled:

GET /v1/user/by/username?username=camhicks_ → 200, 54,148 followers 

Trailing underscores are legal and those are real people. The cleanup has to know the rule, not pattern-match on "looks like punctuation". Mine now strips trailing periods only, lower-cases, and de-duplicates — 307 values became 303, and none of them end in a period.

The expensive part: the caption is not the guest list

While I had the raw payloads open, I compared what the caption claims to what the rest of the answer contains. Instagram's post object has a field called coauthor_producers — the accounts a collab post is jointly published to, the ones you see under the author's name in the app.

Posts with at least one co-author 170 of 281
…where a co-author is not named in the caption 151
…where the caption mentions nobody at all 86

Eighty-six posts came out of my Actor with "mentions": [] while Instagram's own answer listed up to five accounts attached to them. One example, a natgeo reel from 7 November:

caption mentions : bertiegregory, disneyplus, hulu. coauthor_producers: disneyplus, natgeoanimals, natgeotv, bertiegregory 

natgeoanimals and natgeotv are co-publishers of that post and appeared in no column of my table. Ranked by how often they were missed: disneyplus 22 times, disneystudios 14, hulu 14, nasa 13, natgeo 12, nikebasketball 12 — exactly the partners anyone doing brand-collaboration research is paying to find.

And there is a third place. usertags.in holds the accounts tagged in the image or video — with x/y coordinates, up to 18 of them on one post:

Source of "who is on this post" Distinct accounts
Caption @mentions 129
coauthor_producers 112
usertags.in 138
Union 245

116 of the 245 accounts attached to these 281 posts appear in no caption anywhere in the sample. The caption knew 53% of the answer, and it was the only one of the three I was reading.

The field that sounds like the answer and is not

Two decoys sit right next to the real data, and both cost me time:

  • fb_user_tags was {"in": []} on 281 of 281 posts. It is a Facebook crosspost field, not Instagram tags. Permanently empty, permanently tempting.
  • has_tagged_users is tri-state — true on 110 posts, false on 39, absent on 132. Here is the cross-tab I did not expect:
has_tagged_users Posts …that actually carry usertags
true 110 0
false 39 0
absent (null) 132 75

Every post with real tags reports null; every post that says true has none. I have no theory for this and will not invent one — I stopped reading the boolean and read the array instead. If you are about to filter on a flag because checking the array seems expensive, check the array once first.

What the rows look like now

Shipped today across the three storefronts that share this code. A real row from the verification run, truncated where the CDN URL runs long:

{ "type": "post", "postUrl": "https://www.instagram.com/p/DeuOR-CjKE9/", "shortCode": "DeuOR-CjKE9", "mediaId": "4012207125530714600", "mediaType": "photo", "ownerUsername": "natgeo", "ownerFullName": "National Geographic", "ownerIsVerified": true, "takenAt": "2026-10-20T16:06:30.000Z", "caption": "Some of the best reasons to travel in 2027 are far from the usual destinations. 🌎…", "hashtags": ["bestoftheworld"], "mentions": [], "coauthors": ["natgeotravel"], "taggedUsers": ["natgeotravel"], "likeCount": 16900, "commentCount": 287, "playCount": null, "videoDurationSeconds": null, "imageUrl": "https://scontent-sea5-2.cdninstagram.com/v/t51.82787-15/858921974_…", "videoUrl": null, "locationName": null, "isPaidPartnership": false, "scrapedAt": "2026-11-16T05:17:53.329Z" } 

That is the whole problem in one row: mentions empty, two other columns naming the partner. Before today the row said nothing about natgeotravel. The verification run — 24 posts from two accounts in 11 seconds — had zero mention values ending in a period, 10 rows with co-authors and one with media tags. Treat both new fields as empty-by-default: 111 of the 281 posts had no co-author at all.

Calling it

Small lists synchronously; long lists as a started run you poll.

curl -X POST "https://api.apify.com/v2/acts/lergassy~instagram-post-scraper-api/run-sync-get-dataset-items?token=$APIFY_TOKEN" \ -H 'Content-Type: application/json' \ -d '{"usernames":["natgeo","nasa"],"maxItemsPerTarget":12}' 

Twelve posts from each of two profiles takes about 11 seconds; 60 posts from one profile, 30 to 50. Handles, @handles and profile URLs all normalise to the same thing. A target that gives nothing — private, wrong handle, no posts — returns one free notice row naming the reason, so 40 handles always come back with 40 explanations. Filter with type != "notice".

Each profile is charged once as a target whether it returns sixty posts or none, because the lookup costs the same either way; rows are charged on top. On the Apify Free plan a run collects the first target in full and charges nothing, which is the honest way to see real volume before paying. The Actor is Instagram Posts Scraper — logged out, Instagram answers a profile request with a redirect to the login screen and its internal API with 401 require_login, which is why this reads through a paid source holding the sessions instead of your cookies.

When this is the wrong tool

  • You want the engagement numbers to be stable. They are not a measurement, they are a reading. Two runs of the same natgeo reel seven hours apart gave 133,808 and 134,581 likes. Store scrapedAt next to the counter or do not compare rows across runs.
  • You want private accounts. Nothing comes back. The lookup is still charged.
  • You want everything a caption implies. Mentions are parsed text. If someone writes "shot with the team at National Geographic" and tags nobody, no field in any API will tell you.
  • You want to post, like or reply. This only reads.

The lesson I am taking out of it: a derived column is a claim, and an untested claim in a dataset is worse than a missing one. mentions: [] reads as "this post credits nobody", which is a fact about my parser pretending to be a fact about Instagram. If you ship a field computed from text, go find the structured field it was standing in for. Mine was two fields over.