Finding an Account's Photos and Videos (The Timeline Won't Show You)
Finding an Account's Photos and Videos (The Timeline Won't Show You)
If you want an account's images, the obvious approach is to fetch their timeline and keep the posts with media attached.
★Measured, that approach misses effectively all of it.★
The media timelines and the regular timeline returned zero overlapping posts in testing — not "a little overlap", ★none★. They are separate views into the same account, and fetching one tells you nothing about the other.
The measured behaviour
| Source | Hit rate | Overlap with regular timeline |
|---|---|---|
| Photos view | ★88% carry images★ | ★0%★ |
| Videos view | ★100% carry video★ | ★0%★ |
| Regular timeline | mixed | — |
Why the overlap is zero rather than partial: ★these are different indexes, not filtered versions of one list.★ The regular timeline is recency-ordered across everything; the media views are their own collections.
The practical consequence: ★code that fetches a timeline and filters for media is not "a slower way to get photos" — it is a way to get almost none of them.★
Each view is its own call — and you generally want more than one.
Reading them
import requests
BASE = "https://api.socialapi.tech"
KEY = "your_api_key"
HDRS = {"X-API-Key": KEY}
def media(username, limit=100):
"""Photos and videos are separate views — fetch both."""
def get(path):
r = requests.get(f"{BASE}{path}",
params={"username": username, "limit": limit},
headers=HDRS, timeout=60)
r.raise_for_status()
return r.json()["data"]
return {"photos": get("/v1/user/photos"),
"videos": get("/v1/user/videos")}
m = media("nasa")
print(f"{len(m['photos'])} photo posts · {len(m['videos'])} video posts")
⚠️ ★Photos and videos come back in different shapes, and this is where scripts silently return nothing.★
In the post payload, photos is a list of URL strings, while videos is a list of objects carrying url, type, thumbnail, and duration_ms. Iterating one the way you iterate the other produces no output and no error — the worst kind of bug.
for p in post.get("photos", []):
download(p) # ★a string★
for v in post.get("videos", []):
download(v["url"]) # ★an object — note the key★
Two more views worth knowing
Highlights — the account's own pinned selection. ★It is the only view where the author has told you what matters★, which makes it a useful shortcut when assessing an unfamiliar account.
Articles — X's long-form posts. These are substantially longer than ordinary posts, and ★we request the plain-text body specifically for this view★ (it is left off elsewhere to keep responses small). For content analysis, an article is worth many short posts.
def articles(username, limit=20):
"""Long-form posts, with full body text."""
r = requests.get(f"{BASE}/v1/user/articles",
params={"username": username, "limit": limit},
headers=HDRS, timeout=60)
r.raise_for_status()
return r.json()["data"]
★Four views, four different answers to "what has this account published."★ Which one you want depends entirely on the question — and using only the default timeline answers a narrower question than most people think they are asking.
All four key off the username — the choice is which question you are asking.
What this is not
This page is about finding media on an account, not about downloading video files.
The distinction matters: ★we return the URLs that come with the post★, and fetching the file itself is a separate step you control. We are a data API, not a download service — and ★the "download this video" tools people search for are a different category of product entirely★.
What the data view is genuinely good for: ★auditing what an account publishes visually, finding the media-heavy accounts in a set, or building a dataset of posts-with-media for analysis★ — all of which need the URLs and metadata, not the bytes.
Questions people ask
How do I get an account's photos? Use the photos view — ★not the timeline with a filter★, which returns almost nothing.
How do I get an account's videos? The videos view, measured at 100% video posts.
Why does filtering the timeline not work? ★The media views are separate indexes, not filtered timelines★ — overlap measured at 0%.
What is tweet media? Images, video, or GIFs attached to a post. ★URLs come with the post data.★
Is there a media viewer? Any tool showing an account's media tab is one — ★the tab is a standard public view★.
How do I download a video from a post? The URL is in the post data; ★fetching the file is your step★. We return data, not files.
Do you provide a video downloader? No — ★that is a different product category★. We return the URLs and metadata.
What resolution do the URLs give? What the platform serves. ★Video entries carry type and duration★ so you can pick.
Why is my photo loop returning nothing?
★Because photos is a list of strings and videos is a list of objects.★ Iterating one like the other silently yields nothing.
How do I handle both media types? Branch on the field. ★Never assume a shared shape★ — this is the single most common bug here.
Can I get the thumbnail? Yes, on video entries. ★Photos have no separate thumbnail field.★
How far back do media views go? Paginated like any timeline — the archive-depth reality applies.
Do media views include reposts? Check before counting — ★a reposted image can appear in the view★ without being the account's own work.
What are highlights? ★The account's own pinned selection★ — the only view curated by the author.
Why use highlights? Fast assessment of an unfamiliar account. ★It is what they want judged.★
What is an X article? A long-form post, far longer than an ordinary one.
Can I get the full article text? Yes — ★the plain-text body is requested specifically for that view★, unlike elsewhere.
Are articles worth fetching for analysis? ★Very★ — one article carries more analysable text than dozens of short posts.
Can I search inside media posts? Search matches post text, ★not what is inside an image★ — what image search does and does not do.
Can I find who posted a specific image? Not through the platform. ★Take the URL to a general reverse-image engine.★
Do GIFs count as video?
They generally come through the video shape. ★Check type rather than assuming.★
Can I get media from a protected account? No. ★Same boundary as everything else about protected accounts.★
How do I build a media dataset? Page the media views and store URLs plus metadata — export patterns.
Does fetching media cost more? It is a normal call — ★you are fetching post data, not the binaries★.
Can I tell how much of an account is visual? Compare media-view volume against timeline volume — ★but do not treat the counts as subsets★.
Can I batch media requests? Per account, page. ★Across accounts, batching applies to profiles and posts★.
Do deleted posts vanish from media views? Yes — what deletion removes.
Is there an image-size limit I should know? The platform re-encodes uploads — ★what you fetch is what it serves★, not the original.
Which view should I default to? ★None — pick by question.★ Photos for images, videos for video, articles for text, highlights for the author's own choice.
What is the biggest mistake here? ★Assuming the timeline contains the media.★ Measured overlap is zero.
The short version
★The media views and the regular timeline returned zero overlapping posts in testing.★ Fetching a timeline and filtering for attachments is not a slower path to an account's photos — it is a path to almost none of them.
★And the two media shapes differ: photos is a list of strings, videos a list of objects.★ Iterating one like the other returns nothing, without an error to tell you.
Our API exposes photos, videos, highlights, and long-form articles as separate views — ★with the article body text requested specifically for that endpoint★, since it is the one case where the full text is the point. Read-only, flat price per call.
What we do not do: download the files. ★We return the URLs and metadata; fetching bytes is a different product, and we are not it.★
Related reading: what image search actually matches · how far back timelines reach · batching across many accounts · exporting what you collect.