Instagram export content: posts, reels, stories and DM media
Your own content is spread across several files. Posts, reels, stories, profile photos, recently deleted, watch history and DM media are all parsed separately. This is what each bucket is, how it is found in the archive, and what can look like a missing post when it is not.
Your content is the part of the export people open first and understand
last. There is no single "your content" folder. Posts, reels, stories,
profile photos, recently deleted items, watch history and the media you sent
in DMs all live in different files, in different formats. Often there is
both a JSON and an HTML copy of each. The parser's job is to find each one by
its path, read it with the right reader, and drop it into the right bucket so
seven different things never get blended into one indistinguishable pile.
If you are still at the request screen, the Instagram export guide lists the settings that decide whether these buckets arrive at all.
Your content is not one folder. Posts, reels, stories, profile photos,
recently deleted, watch history and DM media are each collected from different
file patterns. The parser scans the tree for those JSON/HTML files and merges
them into separate buckets so nothing gets blended incorrectly — and when the
JSON side comes back empty, it knows to fall back to the HTML copy rather than
report that you never posted.
- 2minthe seven buckets and why they are separate.
- 5minhow each bucket is found (the exact path patterns).
- 4minthe failure modes that look like a missing post but are not.
Your content is not one folder
The content parser returns one structure with six buckets plus DM media:posts, reels, stories, profilePhotos, recentlyDeleted,watchHistory and dmMedia.1 Each is populated by matching file
paths — not by guessing from a single your_content file that does not
exist. That design choice is the reason a given piece of media shows up in
exactly one bucket, and the reason a new export shape breaks one reader instead
of the whole view.
How files are found: patterns, not guesswork
Every bucket is defined by a path predicate. This is the whole discovery
model in one table:2
| Bucket | File pattern (case-insensitive) | Reader |
|---|---|---|
| `posts` | `posts.json`, `posts_<n>.json`, `other_content.json` | `collectPosts` + `collectOtherContent` |
| `reels` | `reel*.json` / `reels*.json` | `parseMediaFile(content, 'caption')` |
| `stories` | path contains `story`/`stories`, or `stories*.json` | `collectStories` |
| `profilePhotos` | `profile_photos.json` | `parseMediaFile` |
| `recentlyDeleted` | `recently_deleted_content/*.json` and `recently_deleted_content.json` | `collectOtherContent` + `collectStories` |
| `watchHistory` | `watch_history.json`, `watched_videos.json`, `viewed_reels.json`, `videos_watched.json` | `collectWatchHistoryJSON` |
| `dmMedia` | `messages/{inbox,message_requests}/<thread>/message_<n>.{json,html}` | `collectDMMediaFromFiles` |
Because matching is by pattern, two facts follow. First, files are sorted
before they are read, so the merge order is stable across machines. Second, if
Meta renames a file the archive is not rejected — that bucket simply comes back
empty, and the empty state is what surfaces in the UI.
- Match a patheach bucket has its own pattern.
- Use the right readerJSON first.
- Drop into a bucketnever blend two kinds.
- Fall back to HTMLonly when the JSON side is empty.
Posts
Posts are the most involved reader. Every posts*.json and other_content.json
file is walked recursively by collectPosts, and an object is treated as a post
entry when it has both an array named media and a timestamp or caption
(creation_timestamp, taken_at, title, or caption). Requiring both is what
stops the walker from mistaking container objects for posts.2
When an entry qualifies:
- The caption becomes both
titleandcaption. - The timestamp comes from the container (
creation_timestamportaken_at). - The first media entry supplies
mediaPathandmediaType. - A location name/address is captured if present.
hashtagsare extracted from the caption text.
other_content.json is read with the sibling collectOtherContent reader,
which also understands nested label_values — the shape Meta uses to label
things like archived or unpublished material — and threads a fallback caption
down through label values whose label matches /caption/i. The result is that
the same post appearing in a structured posts.json and a label-drivenother_content.json can both contribute without either being dropped.
GPS enrichment. Posts then pass through one more step: everymedia_map_data.json file is read into a map keyed by media path, and any post
whose mediaPath appears in that map receives gps coordinates
(lat/lng/accuracy). The map is built before posts are enriched, so the
coordinate state is complete rather than order-dependent.2
Reels
Reels use a lighter reader. Files matching /reels?(_\d+)?\.json$/i are parsed
with parseMediaFile(content, 'caption'), the shared media-file logic that
walks for objects carrying a uri plus a timestamp. The 'caption' argument
tells it to look under the caption key first for the label, falling back totitle. This is the same reader profile photos use — with no caption key — so
the two buckets stay consistent.2
Stories
Stories get a bespoke reader for a good reason: story JSON repeats the sameuri in more than one place, and naive walking double-counts it. collectStories
keeps a Set of seen uri values and skips any repeat, so each story appears
once.2 It also prefers the per-media timestamp (m.creation_timestamp
or m.taken_at) and only falls back to the container timestamp — a story
captured at 09:14 and posted at 09:20 should show 09:14. The walk deliberately
skips the keys media, media_list_data, media_map_data and fbid when
recursing, so it descends into the rest of the structure without re-entering the
media arrays it has already handled.
The path predicate is deliberately broad: any JSON file whose path contains astory/stories segment, or that is itself named stories*.json, counts.
That catches stories.json at the root and your_instagram_activity/stories/
subfolders alike.
Profile photos
profile_photos.json is parsed with parseMediaFile and no caption key, so a
profile photo's label comes from title or caption if present and is
otherwise empty. Profile photos are a small, oddly-shaped set — you may have
changed your picture dozens of times — and keeping them in their own bucket
stops them inflating the post count.
Recently deleted
Recently deleted items are collected from two shapes, because Meta writes them
in two. Files under recently_deleted_content/ (any *.json) are read with theother_content reader, while the standalone recently_deleted_content.json is
read with the stories reader. Both flow into the same recentlyDeleted
bucket.2 The practical consequence: a deleted story and a deleted post
can both land here, and their captions inherit the same label-value handling theother_content reader provides.
Watch history
Watch history is the bucket people forget exists in their export. The parser
reads JSON files named watch_history.json, watched_videos.json,viewed_reels.json or videos_watched.json (case-insensitive), plus HTML files
with matching names or paths.2 The JSON reader is shape-tolerant: for a
record with string_map_data, it looks for a key matching /reel|video|watch/i
and takes that entry's href and timestamp, falling back to the first key
whose entry carries a timestamp. If instead it finds a plain object with a uri
and a timestamp, it uses that. Watch-history rows carry an href (the link
Instagram recorded) and no mediaPath, because the export does not include the
video itself.
DM media
Media you sent in direct messages is your content too, but it is stored with the
messages, so its reader is threaded rather than file-globbed. collectDMMediaFromFiles
matches messages/inbox/<thread>/message_<n>.json (andmessages/message_requests/..., and the .html variants), extracts the thread
folder name, strips a trailing _<digits>, and uses the result as the item'schat label.2
Two details matter here:
- Mojibake repair. Sender names and thread names arrive as Latin-1-mangled
UTF-8, the same way they do in the Messages parser. Both are run through
repairLatin1Mojibakeso the "???" symbol garbage never reaches the UI, and
the fragment already repaired in the Messages view and the fragment here stay
consistent.2 - Timestamp preference and media type. For each message,
photos[0].uriand
videos[0].uriproduce entries, with the media's owncreation_timestamppreferred over the message timestamp, andmediaType
set to 2 for video and 1 for photo. The HTML reader mirrors this: it scans
table rows, takes an<img>'ssrcor an<a>'shrefthat ends in a
media extension, and marks.mp4/.mov/.webmlinks as video.
DM media is surfaced under Content rather than Messages because it is a
content library: the Messages view is about the conversation, while Content
is about the media itself. The Content view lets you filter dmMedia by
conversation, which is why each item carries its chat label.
The HTML fallback
Every bucket above has an HTML copy in most exports. For posts and watch
history, the parser does not prefer HTML — it uses it only when the JSON
side yields zero posts. In that case parseJSON's caller receives an emptyposts array, parseHTML runs, and if it finds posts the HTML result is
returned, with dmMedia inherited from whichever side produced it.2
HTML media extraction is different in kind: collectHTMLMedia scansa[href] links ending in an image/video extension, deduplicates by href, finds
the enclosing table row, and pulls a date like Aug 3, 2021 from the row text
for the timestamp.2
The fallback exists because "zero posts" is almost never the truth — it is
usually a JSON shape change or a JSON file that failed to parse. Falling back to
HTML is how the parser avoids telling you your account was empty when it merely
misread one file.
What can look like a missing post (but is not)
The failure modes are worth naming, because each has a distinct cause and a
distinct fix:2
- JSON came back empty, HTML did not. The fallback fired. You are seeing
HTML-derived posts with corrected timestamps but no caption labels.
- A renamed file. Path matching is exact; a bucket that stops matching
silently empties. The empty state in the view is the clue.
- A media entry with no
uri. Stories and DM media require auribeforethey become items; a record that names media but not its file is skipped.
- A deduplicated
uri. Stories and DM thread folders are deduped; the"missing" item is often the second copy of one you already have.
- A timestamp-less record. Most readers require some timestamp; a
correctly-shaped entry with none is dropped rather than shown at epoch zero.
- Deleted ≠ gone. Recently deleted items are in their own bucket, not
among your posts; looking for them under Posts will not find them.
Timestamps: the fallback chains
Every bucket carries a timestamp, and every bucket computes it with a fallback
chain rather than trusting one field. Knowing the chain explains the single
most common "my post has the wrong date" complaint.2
- Posts take the timestamp from the container, trying
creation_timestampthentaken_at. The parser looks at the entry, not each
media item — which is why a carousel shows one date even though its images may
have distinct creation times. - Stories prefer the media's own timestamp (
m.creation_timestamp,m.taken_at) and fall back to the container's, so a story posted later than
it was captured still reads as captured. - DM media prefers the media's
creation_timestamp, then the message'stimestamp_msconverted to seconds. - Reels, profile photos and watch history use their own chains:
taken_at || creation_timestamp || timestampfor the media readers, and thestring_map_datatimestamp for a watched reel.
The honest limit here is the same one the export can never escape: a date the
export does not contain cannot be recovered. When the chain lands on 0, the
UI shows an empty date rather than inventing 1 January 1970.
What hashtags do and do not capture
Hashtags are extracted with a single regex, #[a-zA-Z0-9_]+, applied to the
caption text. That has two consequences worth knowing before you read the
hashtag cloud.2
First, it is deliberately ASCII: hashtags written in non-Latin scripts, or
using characters outside letters, digits and underscore, are not extracted. The
caption itself is preserved verbatim — only the tag cloud is ASCII-bound.
Second, extraction works from the caption string, so a tag that was only ever
an image, a sticker or a mention is not a hashtag here. The count answers "which
hashtags did I type", not "which did the platform associate with the post".
The Content view
The view exposes the buckets as tabs — Overview, plus one per media bucket, with
live counts. The Overview tab turns the text side of your content into
readable facts: top hashtags (a size-and-opacity cloud), content by month, a
day-by-hour posting heatmap, and best posting times. It also shows caption
analysis — average words, words per sentence, and the share of captions that
ask a question — and a hashtag category doughnut.3 The header is explicit
about the local-mode promise: everything is "opened from your own media library
on this device", photos and videos never leave the browser, and only your
archive's text is stored.3
The media tabs are a lazy grid — 60 items initially, "Load more" in
increments of 120 — and each card lazily reads its blob on demand rather than
holding the whole library in memory.3 For DM media, a conversation filter
appears when more than one chat exists, defaulting to all chats and falling back
to all if the selected chat disappears when you switch archives.
- TabsOverview plus one per media bucket.
- Overview factshashtags, by-month, heatmap, best times.
- Media grid60 items, then 120 more.
- DM media filterby conversation.
Why is DM media in Content instead of Messages?
DM media is your content shared in chats. It is surfaced in the content view asdmMedia with an associated chat label so it can be filtered by conversation,
while the Messages view stays focused on the conversation itself.
My posts.json is empty but I see posts in HTML?
If JSON produces zero posts, the parser falls back to HTML posts and still
merges DM media. You are seeing the fallback result, which can differ slightly in
caption and timestamp fidelity.
Are stories deduplicated?
Yes. Stories are deduplicated by uri so the same media is not counted twice
when the JSON structure repeats it.
Does the export include recently deleted items?
If present under recently_deleted_content, they are collected into the separaterecentlyDeleted bucket — not mixed into your posts.
Why does DM media show a chat name but no message text?
DM media items carry the media and its conversation label; the message text
belongs to the Messages view. Content answers "what media was shared", Messages
answers "what was said".
Why do some captions end in an ellipsis or lose their hashtags?
Captions are trimmed for display, and hashtags are extracted from the caption
text — a caption that was empty upstream cannot yield hashtags downstream. The
stored caption is the source of truth.
Why does my Content total not match what Instagram shows?
The export captures the content Meta included at request time, and it counts by
media entries rather than by the platform's own post counter. A carousel, a
re-share, a deleted-then-restored item and a story can all shift the numbers, so
treat the export total as the archive's count, not Instagram's.
Why the JSON and HTML copies can disagree
Every export ships two parallel renderings of the same content: a machine JSON
file and a human HTML file. They are generated from the same source, but they
are not byte-identical in what survives, and the parser prefers JSON for a
reason.2
The JSON copy keeps typed fields — creation_timestamp, media_type,media_map_data coordinates — that the HTML copy flattens into text. The HTML
copy, in exchange, is more forgiving of a missing URI: it can expose an imgsrc or an a href the JSON left empty. That is exactly why the fallback runs
when JSON yields zero posts: a partial JSON failure plus a complete HTML
render is the case the fallback rescues, and a re-parse that leaves the JSON
side intact is the case where HTML is correctly ignored.
The practical rule for reading your own archive: trust the committed bucket,
note which rendering supplied it, and treat a caption or timestamp that looks
"off" as a property of that rendering rather than a bug. The parser never
silently mixes a JSON post with its HTML twin — it picks one rendering for the
posts bucket as a whole.
Sources of truth
- The content types —
MediaItem,GpsCoordsand theContentDatabucket list. - The content parser — path-based collection for
posts/reels/stories/profile photos/recently deleted/watch history, the
media_map_dataGPS enrichment, and DM media extraction from message shards
with mojibake repair and timestamp preference. - The content view — tabs, overview analytics and the DM
media conversation filter.
Footnotes
For developers — source references
Pointers into the open-source code that implements the behaviour described above.
packages/shared/src/types/content.ts:7-29—MediaItem(with
optionalhref,location,gps,chat),GpsCoords, andContentData'sposts/reels/stories/profilePhotos/recentlyDeleted/watchHistory/dmMedia.↩packages/shared/src/parsers/content.ts—collectPosts:24-38
(media+timestamp predicate, caption→title, location, hashtags),collectStories:57-109(uri dedupe, per-media timestamp preference, skipped
keys),collectOtherContent:111-154(label_values,/caption/i),parseMediaFile:156-174,collectHTMLMedia:176-196,collectMediaMap:198-215
(GPS),collectWatchHistoryJSON:217-271(string_map_data,href),collectWatchHistoryHTML:273-283,collectDMMediaJSON:285-328(mojibake
repair,photos[0]/videos[0], timestamp preference),collectDMMediaHTML:330-365,collectDMMediaFromFiles:367-389(thread-path
regex),parse:391-405(JSON→HTML fallback),parseJSON:407-482,parseHTML:484-502.↩apps/web-next/src/views/Content.tsx—TABS:18-29, header copy:131, overview analytics:150-226, DM chat filter:232-243, media grid and
"Load more":245-253.↩