Kartik Bihani API documentation
Public read-only content API: authentication, endpoints, schemas, errors, and examples for Kartik Bihani's journal.
Authentication
No authentication, account, or API key is required. All documented operations are public and read-only. GET and HEAD are supported; other methods on the JSON API routes return 405 with a structured JSON error and an Allow header. There are no write, messaging, payment, or account-management operations.
When to use this
Use this API to find and cite Kartik's published writing, answer questions about his documented experiences, or check for changes to an article. Attribute quotes and summaries to Kartik Bihani and link to the canonical article URL. Personal essays are not professional advice. Request only what you need, cache successful index responses according to Cache-Control, and space automated requests by at least one second. This is a client courtesy interval, not an enforced quota or service-level guarantee.
Endpoints
GET /api/contentList all published content with canonical paths, dates, counts, and content hashes.
GET /thoughts/{id}/jsonRead a thought's full text, tags, publication date, and Article JSON-LD.
GET /letters/{id}/jsonRead a letter's full text, publication date, and Article JSON-LD.
GET /life/{year}/{id}/jsonRead a life entry's full text, year, optional image, and Article JSON-LD.
GET /content-manifest.jsonRetrieve the build-time content manifest with normalized dates and site identity.
Start with GET /api/content to find an item's id and canonical path. For thoughts, letters, and individual life entries, append /json to that path to retrieve the full text. Yearly reflections are listed in the index and can be read at their canonical HTML page. API publication dates preserve the original human-readable date strings; content-manifest.json uses YYYY-MM-DD dates. Content hashes identify changes, not authenticity or security guarantees.
Example requests
curl -sS 'https://kartikbihani.com/api/content'
curl -sS 'https://kartikbihani.com/letters/first-letter/json'
curl -sS -i -H 'Accept: text/markdown' 'https://kartikbihani.com/'Content negotiation
The homepage serves Markdown at the same URL when Accept: text/markdown is preferred, and HTML when Accept: text/html is preferred. Responses include Vary: Accept, honor quality weights and exclusions, and return 406 if neither representation is acceptable. Unknown pages return HTTP 404, with a Markdown error and discovery links when Markdown is requested. JSON API URLs always return JSON, including errors.
Errors
Errors have an error object containing code, message, hint, and docs. NOT_FOUND (404) means you should discover a valid path in /api/content or /docs. METHOD_NOT_ALLOWED (405) means retry with GET or HEAD. API requests do not require credentials. If hosting infrastructure returns 429, honor Retry-After when provided and retry later with backoff.
{
"error": {
"code": "NOT_FOUND",
"message": "The requested content was not found.",
"hint": "Find a valid content path in /api/content.",
"docs": "https://kartikbihani.com/docs"
}
}