What I Learned Building a Local App for My X Bookmarks
I built a small app that reads my X bookmarks, saves them locally for later, summarizes the long ones, and fact-checks them with Claude…
What I Learned Building a Local App for My X Bookmarks
I built a small app that reads my X bookmarks, saves them locally for later, summarizes the long ones, and fact-checks them with Claude. Along the way, I finally learned how to work with the X developer API and Anthropic tokens — here’s the whole thing.
It started with a bookmark I almost believed.
I follow markets, and X is where a lot of investment theses show up first. I’d saved a long, confident post arguing that a household-name tech company was quietly the most overlooked AI-infrastructure play around — numbers, quotes, partner names, price targets. It felt true.
So I checked it. Most of it held up, but the framing quietly spun one key detail: the stock had already run past most analyst targets, which is roughly the opposite of the “Wall Street is about to catch up” story the post was telling.
That little gap between "feels true" and "is true" gave me a reason to build something. But I had a second motive, just as real. I’d been wanting to get my hands dirty with developer APIs, to actually learn how authentication tokens, OAuth, and paid API access work instead of reading about them. A personal tool I’d genuinely use was the perfect excuse.
This is what I built, what I learned, and how you can run your own. The code is on GitHub (link at the end).
What it does
It’s a small app that runs entirely on my own machine. Open it in a browser and it:
- Reads my X bookmarks as a clean, searchable list — with full text even for X’s long-form posts (the API truncates those unless you ask correctly).
- Saves a bookmark locally for later — one click appends the post’s text, author, and link to a single growing
.txtfile, so the good ones don't get lost. - Summarizes a long post — a quick, cheap TL;DR from Claude for those thesis-length posts I keep saving but never finish.
- Fact-checks a post with Claude — Claude assesses how factually correct it is, searching the web for anything time-sensitive instead of guessing from memory.
There’s also search, author filtering, and sorting on top, which you end up living in once you have a few hundred bookmarks.
But the part I actually want to talk about is what building it taught me about two developer platforms I’d never properly used.
Lesson 1: working with the X developer API
I assumed reading my own bookmarks would be trivial. It was the hardest part, and it’s where most of the learning happened.
API access isn’t free anymore. As of early 2026, X runs on pay-per-use — no free read tier, and you can’t sign up for the old plans. The upside: reads of your own data (posts, bookmarks, lists) are cheap, around a tenth of a cent each. Lesson one was simply understanding that every call has a price, and learning to read the billing/usage page in the developer console.
Not all tokens are equal. This was the big one. My first instinct was to grab an app-only bearer token from the dashboard and go — doesn’t work for bookmarks. Reading your own private data requires user-context authentication: OAuth 2.0 with PKCE, where you authorize the app in a browser, it exchanges a code for an access token and a refresh token, and then quietly refreshes that token forever. Understanding the difference between an app-only token and a user token — and why bookmarks need the second kind — is the single most useful thing I took from this project.
Setup has sharp edges. The app has to live in a Production environment, registered as a “Public client” with the callback URL matched exactly. Get one detail wrong and you get an opaque 403. I also learned that brand-new pay-per-use apps sometimes aren't enrolled correctly on X's side, returning 403 no matter what — so before writing a line of real code, I wrote a tiny smoke-test script that just runs the OAuth flow and hits one endpoint. HTTP 200 and you're clear. That habit — prove the auth works before building on it — saved me hours.
And the small gotchas teach you to read the docs. Long posts came back truncated mid-sentence until I learned X hides the full text in a separate note_tweet field you have to explicitly request. Half of API work, it turns out, is knowing the magic words.
Lesson 2: working with the Anthropic API
The fact-check and summarize features run on Claude, and this was my first time calling the Anthropic API directly rather than through a chat window.
The key is just a token, and it belongs on the server. You get an API key from the Anthropic console, and the most important thing I internalized is where it goes. The app never puts it in the browser. A small backend holds the key and makes the calls; the frontend only ever talks to my own local server. Same principle as the X tokens — secrets live server-side, never in client code.
The Messages API is refreshingly simple. A fact-check is one HTTP POST: your prompt, a model name, and a max token count. What surprised me is that you can hand Claude a web-search tool in the same request and let it decide when to search, read results, and cite them — which is exactly what makes the fact-check trustworthy instead of a confident guess from stale training data.
Tokens cost money, and you can feel it. My first fact-check quietly cost seven cents, which sent me down a useful rabbit hole. Web search is billed separately (about a cent per search), and every page Claude reads becomes input tokens you pay for. Learning to read the usage numbers — and then giving myself control over them — was the practical payoff.
Run your own copy
About 20–30 minutes, most of it in the X developer console.
- Smoke-test auth first. Run the included script;
HTTP 200means user-context auth works on your account,403means you've hit the enrollment issue. - Set up an X app in Production, as a Native App (Public client), Read permission, callback
http://localhost:3000/callback. Copy the OAuth 2.0 Client ID and add a little credit. - Get an Anthropic API key from console.anthropic.com (only needed for Summarize/Verify).
- Clone and run:
bash
X_CLIENT_ID="your_client_id" \
ANTHROPIC_API_KEY="sk-ant-..." \
node server.js
Open http://localhost:3000, click Connect X account once, authorize, and your bookmarks load. It's a zero-dependency Node app — if you have Node 18+, you're ready.
What it costs
Running the app is free; you only pay for the calls it makes. Loading bookmarks is fractions of a cent (one cheap “owned read” per 100 posts). Saving is a free local file write. Summarize is cheap — no web search. Fact-checking is the priciest action, so it has two modes: Quick (no search, cents) for opinion posts, and Deep (web search, a few cents) for posts making specific claims. Every check prints exactly what it cost. Trust your developer-console billing over any estimate — pay-per-use rates change.
A few honest notes
This is a personal, single-user tool — it reads my own account and shows data only to me. Keep your keys and the generated token file out of version control. And an AI fact-check is a starting point, not a verdict: great at catching spin and stale numbers, but not an oracle. None of this is financial advice.
Below is an example of using the verify feature on a tweet I bookmarked:


Wrapping up
The tool is genuinely useful — the friction of checking a dubious claim dropped to a single click. But the real win was the learning. I came in fuzzy on using API tokens, and came out understanding app-only versus user-context auth, OAuth with PKCE, refresh tokens, pay-per-use billing, and how to call the Anthropic API with a key kept safely server-side. That knowledge transfers to basically any developer platform I touch next.
If you want to build your own, the full code and setup steps are here: https://github.com/nonysingh/bookmark_explorer
메타데이터
- post_id
- 1edce94caace
- slug
- what-i-learned-building-a-local-app-for-my-x-bookmarks-1edce94caace
- url
- https://medium.com/@hsingh1982/what-i-learned-building-a-local-app-for-my-x-bookmarks-1edce94caace
- canonical_url
- https://medium.com/@hsingh1982/what-i-learned-building-a-local-app-for-my-x-bookmarks-1edce94caace
- author_url
- https://medium.com/@hsingh1982
- status
- ok
- fetched_at
- 2026-06-09 15:37:30