Skip to content

Harlaksh Singh API

API documentation for this site. Public and read-only: no keys, no sign-up, anything you can fetch you can use.

Endpoints

GET/api/v1/posts
The latest posts: slug, title, date, category and excerpt. Add ?limit=1 to 20 for more than the default four. Use this path for integrations.
GET/api/posts
Unversioned alias that always serves the current version.
GET/api/activity
The live activity feed: anonymous city-level visits, appreciations, GitHub events and posts, plus today's totals and map points. Cached for 15 seconds.
GET/api/bombay
Current weather in Bombay from Open-Meteo (CC BY 4.0), cached for 15 minutes.
GET/api/subscribe
The letters list. GET returns how many confirmed readers are on it; POST with an email signs it up and Kit emails a confirmation link (rate-limited, humans only).

Errors come back as JSON with a code and message. Unknown /api/* paths return a JSON 404, not an HTML page.

Versioning and deprecation

Versions live in the path. Breaking changes get a new version and the old one keeps working for at least six months. A retired version answers with Deprecation (the date it was announced) and Sunset (the date it stops working) response headers, and a Link header pointing at its replacement. New fields don't create a version, so ignore fields you don't recognise.

Rate limits

Please stay under 60 requests a minute. Responses include RateLimit-Limit, RateLimit-Policy and RateLimit-Reset. Nothing is enforced today; if that changes, 429 responses will carry Retry-After.

Markdown and caching

Any page returns Markdown from the same URL when you send Accept: text/markdown. Responses carry Vary: Accept, so cache the two representations separately.

Machine-readable files

Responses also carry a Link header naming those files, so a client that only reads headers still finds them.

Examples

# Latest posts as JSON
curl https://www.harlakshsingh.com/api/v1/posts

# Any page as Markdown
curl -H 'Accept: text/markdown' https://www.harlakshsingh.com/