Export Twitter Bookmarks to CSV with X's API (2026)
X's archive help doesn't list bookmarks, so export Twitter bookmarks with X's API: endpoint, scopes, the 800-post question, cost, and a tested script.
Tarun Khatri
Published · Updated · 6 min read
To export Twitter bookmarks, call X's bookmarks endpoint with your own user token and page through it, because X's archive help doesn't list them.
This is for anyone on X (Twitter) who wants their saved posts in a spreadsheet. You get the API details X documents, a Python script we ran, the cost, and where bookmarks live.
Adapted from X's quickstart, with your id and user token:
curl "https://api.x.com/2/users/$MY_USER_ID/bookmarks?max_results=100&tweet.fields=created_at,author_id" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN"
You need an X account, an X developer app with credits, and Python with requests.
- Create an X appAt console.x.com, then buy credits.
- Get a user tokenOAuth 2.0 with PKCE and bookmark.read.
- Page the endpoint100 posts a page, following next_token.
- Write the CSVOne row per bookmark.
Step 1: Get an X app and a user token with bookmark.read
Bookmarks are private, so X wants a token for you, not just your app. Create an app at console.x.com and buy credits first. Our guide to getting an X API key covers both.
Then sign in through OAuth 2.0 with PKCE. X's bookmarks quickstart lists three scopes:
bookmark.readreads your bookmarks.tweet.readandusers.readread the posts and accounts in them.offline.accessis optional. X's PKCE page says tokens last two hours without it.
Your numeric id comes from GET /2/users/me. We called the bookmarks endpoint with no token on 22 October 2026, and X answered:
{ "title": "Unauthorized", "type": "about:blank", "status": 401, "detail": "Unauthorized" }
With a made-up token, X returned a 403 saying app-only authentication "is forbidden for this endpoint." A plain bearer token won't do.
Step 2: Get bookmarks from the X API, 100 at a time
X's reference takes max_results from 1 to 100 and returns meta.next_token while more pages remain. This loop follows it, with a 20-page ceiling:
import csv, os, requests
API = os.environ.get("X_API", "https://api.x.com") # we pointed this at a local stub
HEADERS = {"Authorization": f"Bearer {os.environ['X_USER_TOKEN']}"} # needs bookmark.read
URL = f"{API}/2/users/{os.environ['X_USER_ID']}/bookmarks" # your id, from /2/users/me
def bookmarks(max_pages=20):
params = {"max_results": 100, "tweet.fields": "created_at,author_id,public_metrics"}
for _ in range(max_pages):
r = requests.get(URL, params=params, headers=HEADERS, timeout=30)
r.raise_for_status() # 401 bad token, 402 no credits, 429 wait
page = r.json()
yield from page.get("data", [])
params["pagination_token"] = page["meta"].get("next_token")
if not params["pagination_token"]:
return
raise_for_status() stops on the first error instead of retrying, so a bad token never loops.
Step 3: Export Twitter bookmarks to CSV
The rest of the same file writes one row per bookmark:
with open("bookmarks.csv", "w", newline="", encoding="utf-8") as file:
writer = csv.writer(file)
writer.writerow(["id", "created_at", "author_id", "likes", "url", "text"])
count = 0
for post in bookmarks():
likes = post.get("public_metrics", {}).get("like_count")
url = f"https://x.com/i/web/status/{post['id']}"
writer.writerow([post["id"], post.get("created_at"), post.get("author_id"),
likes, url, post["text"]])
count += 1
print(f"saved {count} bookmarks to bookmarks.csv")
We have no X API key, so we ran it against a local stub that returns X's documented response. Page one is X's own quickstart example, with a next_token; page two is empty. Our run on 22 October 2026, trimmed:
$ python export_bookmarks.py
saved 2 bookmarks to bookmarks.csv
$ head -2 bookmarks.csv
id,created_at,author_id,likes,url,text
1501258597237342208,2024-01-15T10:30:00.000Z,2244994945,89,https://x.com/i/web/status/1501258597237342208,Have you built a project ...
The script sent the next_token back, got no new one, and stopped. Pointed at api.x.com with a fake token, it stopped on X's real 403.
How many bookmarks can you export, and what does it cost?
Plan for 800. X's older docs said "you will get back 800 of your most recent Bookmarked Tweets." Those date from 2024, today's reference names no cap, and we couldn't test it without a key.
Your bookmarks count as an Owned Read when your own account owns the app. That's $0.001 per post. A bookmark tool you sign in to doesn't qualify, because you don't own its app.
In April, an X staff reply said the bookmarks discount was "rolling out progressively," so check your first charge in the console. Our X API Owned Reads guide has the full rule.
Does the X archive include bookmarks?
Not that X says. Its archive help page lists "your profile information, your posts, your Direct Messages," media, followers, following, your address book and Lists. Bookmarks aren't named, though the list ends "and more."
We didn't request an archive to check. If yours has bookmarks, use it, since it's free. If not, the API is the official route.
How to see your Twitter bookmarks and folders
X's Help Center puts them one tap away. In the iOS app, open the Bookmarks tab in your nav menu. On Android and the web, tap Bookmarks in your profile icon menu.
The same page says bookmarks "are private and are only viewable to you within your X account."
Bookmark folders come with X Premium, from the Basic tier up, per X's Premium page. The API reads them too: GET /2/users/:id/bookmarks/folders lists your folders, and /folders/:folder_id lists one folder's posts.
If the export doesn't work
- 401 Unauthorized: the token is missing or expired. Refresh it or sign in again.
- 403 Unsupported Authentication: you sent an app-only bearer token. Use a user token.
- 402 Payment Required: your credits ran out. Our X API 402 guide has the fix.
- 429 Too Many Requests: wait for the 15-minute window to reset.
- Folder posts are missing: they may need the folder endpoint, one folder at a time.
When not to use Weir
We run Weir, a read-only API for public X and Reddit data. For this job, use X instead:
- You want your bookmarks. They're private, and Weir reads public data only.
- You want your likes, mutes or home timeline. Weir never holds your X token, so it can't see them.
- You want to save new bookmarks. Weir only reads, and X's API charges $0.005 per bookmark write.
Weir fits when you read other accounts' public posts.
FAQ
Can you export Twitter bookmarks?
Yes, through X's API. Call GET /2/users/:id/bookmarks with your own user token and the bookmark.read scope, 100 posts per page. X's archive help page doesn't list bookmarks, so the API is the official route.
How do I download Twitter bookmarks without an extension?
Use the Python script above with your own X app and user token. It pages through the bookmarks endpoint and writes a CSV. Your own app reads them at $0.001 each as Owned Reads.
Does the Twitter API return all my bookmarks?
Maybe not. X's 2024 docs said the endpoint returns your most recent 800, and today's reference is silent on a cap. Folder posts have their own endpoint. Compare your row count with your Bookmarks tab.
How do I see my bookmarks on X?
In the iOS app, open Bookmarks from the nav menu. On Android or the web, tap Bookmarks in your profile icon menu. X's Help Center says only you can see them.
Sources
All checked on 22 October 2026. We read docs.x.com as Markdown, adding .md:
- X Help Center, bookmarks (Wayback, 4 September 2026): https://web.archive.org/web/20260904174205/https://help.x.com/en/using-x/bookmarks
- X Help Center, download your archive (Wayback, 15 October 2026): https://web.archive.org/web/20261015124209/https://help.x.com/en/managing-your-account/how-to-download-your-x-archive
- X Help Center, your X data (Wayback, 13 October 2026): https://web.archive.org/web/20261013151543/https://help.x.com/en/managing-your-account/accessing-your-x-data
- X Help Center, X Premium (Wayback, 10 October 2026): https://web.archive.org/web/20261010222205/https://help.x.com/en/using-x/x-premium
- X bookmarks overview and quickstart: https://docs.x.com/x-api/posts/bookmarks/introduction and https://docs.x.com/x-api/posts/bookmarks/quickstart/bookmarks-lookup
- X API reference, bookmarks and folders: https://docs.x.com/x-api/users/get-bookmarks and https://docs.x.com/x-api/users/get-bookmark-folders
- X OAuth 2.0 with PKCE: https://docs.x.com/fundamentals/authentication/oauth-2-0/authorization-code
- X rate limits: https://docs.x.com/x-api/fundamentals/rate-limits
- X API pricing, Owned Reads: https://docs.x.com/x-api/getting-started/pricing
- X bookmarks docs (Wayback, 23 February 2024): https://web.archive.org/web/20240223163207/https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/introduction
- X forum, bookmarks billing (Wayback, 21 April 2026): https://web.archive.org/web/20260421184300/https://devcommunity.x.com/t/owned-reads-0-001-rate-not-applied-to-bookmarks-endpoint-billed-at-0-005-instead/263311
- Our script run against a local stub, and our calls to api.x.com, 22 October 2026