Burrows Tools API
Almost everything on this site runs in your browser. These are the only server-side endpoints there are: one that reports what the network says about your location, and one that fetches the captions YouTube publishes for a video. They exist to serve this site's own pages, and they are written down here so that a person — or an agent — reading the site can see exactly what they do.
Version 1.0.0 of this description. Last updated: .
Usage terms
Read these before you point anything automated at the endpoints below. They are short, and the third one is the one that matters.
- These endpoints exist to serve the pages on this site. They are documented so that the site is legible to a person or an agent reading it, not to offer a public data service.
- There is no SLA and no support commitment. Availability, response shapes, limits and the existence of a route may change without notice, and a route may be withdrawn.
- No bulk or automated harvesting. /api/youtube-transcript fetches from YouTube on this site's behalf, so a client looping over video ids spends this site's request budget and can get its egress throttled or blocked upstream — a cost the caller never sees. Light, interactive use is welcome; scripted extraction is not.
- Traffic that looks like harvesting may be rate-limited, blocked, or answered with an error, under the acceptable-use section of the Terms of Service.
- No CORS headers are sent, on purpose. A browser on another origin cannot read these responses; that is a deliberate limit, not an oversight to work around.
- Whatever /api/youtube-transcript returns is material YouTube published, and YouTube's own terms govern what you may do with it.
These sit under the acceptable-use section of the Terms of Service, which govern the whole site. What the endpoints do with what they receive is described in the Privacy Policy.
Machine-readable descriptions
The same information as this page, for software that would rather not read prose.
- /.well-known/api-catalog
- The API catalog, as application/linkset+json — an RFC 9727 linkset naming every endpoint below, with links to its description, its documentation, and the health check.
- /openapi.json
- An OpenAPI 3.1 description of every endpoint: parameters, status codes, response headers, schemas and examples. Generated from the same source as this page, and checked against the running routes by the test suite — so if it and the endpoint disagree, the build is already red.
Caller location
GET /api/geo
Answers with what the network says about whoever asked: address, municipality, region, postal code, country, coordinates and time zone. Everything comes from the connection itself — Cloudflare's request metadata plus the CF-Connecting-IP header — so there is no third-party geolocation service between the caller and the answer.
The city is resolved from the coordinates rather than taken from Cloudflare's city label, because the two disagree: the label names the town a provider routes a connection through and the coordinates name a point. The citySource field says which one answered, and any failure in that lookup falls back to the label rather than to an error.
The answer is different for every caller, so it is never cached, and no Access-Control-Allow-Origin header is sent — a page on another origin cannot read it.
Request
No parameters.
curl "https://burrows.tools/api/geo"Responses
Always application/json. Every outcome this endpoint can produce is listed — there is no undocumented fourth thing it does.
200 · geo-ok
The caller's location. This route has no failure mode of its own.
- Cache-Control:
- no-store
- Vary:
- CF-Connecting-IP
Coordinates named a different municipality than the label did
{
"ip": "203.0.113.24",
"city": "Lake Mary",
"region": "Florida",
"regionCode": "FL",
"postalCode": "32746",
"country": "US",
"latitude": 28.76,
"longitude": -81.32,
"timezone": "America/New_York",
"source": "cloudflare",
"citySource": "coordinates"
}The lookup added nothing, so Cloudflare's own label stands
{
"ip": "203.0.113.24",
"city": "Sanford",
"region": "Florida",
"regionCode": "FL",
"postalCode": "32771",
"country": "US",
"latitude": 28.8,
"longitude": -81.27,
"timezone": "America/New_York",
"source": "cloudflare",
"citySource": "label"
}Local development, where the edge has no location to give
{
"ip": "127.0.0.1",
"city": "Localhost",
"region": "Development",
"regionCode": null,
"postalCode": "00000",
"country": "XX",
"latitude": 0,
"longitude": 0,
"timezone": "UTC",
"source": "stub",
"citySource": "label"
}YouTube transcript
GET /api/youtube-transcript
Takes a video id or any YouTube URL and returns the video's caption track as prose. It powers the /youtube-transcript tool page and nothing else.
This is the one route that talks to a third party, and it does so on this site's behalf: a single request here becomes up to four requests to YouTube from this site's egress. That is why the usage terms above are not boilerplate — a client looping over ids is spending someone else's budget and standing. Successful answers and definitive failures are cached, so a repeated lookup of the same id is close to free; a stream of fresh ids is not.
YouTube changes these surfaces often, so every failure is a typed error rather than an exception. Branch on the error field, never on message, and treat upstream-changed as transient — it means nothing upstream said anything recognisable about the video, which covers an outage, a timeout and a consent wall alike.
Request
- id (optional)
- A video id, or any YouTube URL: watch links, youtu.be short links, Shorts, embeds and live URLs all parse.
- url (optional)
- Accepted as an alias for id, and read only when id is absent. Supply one of the two: with neither, the answer is bad-id.
curl "https://burrows.tools/api/youtube-transcript?id=dQw4w9WgXcQ"Responses
Always application/json. Every outcome this endpoint can produce is listed — there is no undocumented fourth thing it does.
200 · transcript-ok
A caption track was found and converted to text.
- Cache-Control:
- public, max-age=86400
- X-Transcript-Cache:
- HIT | MISS
An automatic English track
{
"id": "dQw4w9WgXcQ",
"languageCode": "en",
"language": "English (auto-generated)",
"automatic": true,
"text": "We're no strangers to love You know the rules and so do I"
}400 · bad-id
Neither id nor url parsed as a YouTube video. Refused before any network or cache work.
- Cache-Control:
- no-store
bad-id
{
"error": "bad-id",
"message": "That does not look like a YouTube link or video id. Paste the full URL from your browser, or the 11-character id."
}404 · no-captions
The video is playable and has no caption track. Held briefly so a repeated probe is not a repeated fetch.
- Cache-Control:
- public, max-age=600
- X-Transcript-Cache:
- HIT | MISS
no-captions
{
"error": "no-captions",
"message": "This video has no caption track, so there is nothing to transcribe. Creators can turn captions off, and very new, very short, or music-only videos often have none."
}404 · video-unavailable
YouTube will not serve the video — private, removed, or members-only. Held as briefly as no-captions.
- Cache-Control:
- public, max-age=600
- X-Transcript-Cache:
- HIT | MISS
video-unavailable
{
"error": "video-unavailable",
"message": "YouTube will not serve this video. Private and members-only videos cannot be transcribed; unlisted ones can, if you have the link."
}502 · upstream-changed
Nothing upstream said anything recognisable about this video. Transient, and never cached — retrying later is the right response.
- Cache-Control:
- no-store
- X-Transcript-Cache:
- HIT | MISS
upstream-changed
{
"error": "upstream-changed",
"message": "YouTube did not return anything we recognise. This usually means they have changed their page again — it is not something you did."
}Health
GET /api/health
Returns 200 with a tiny JSON body whenever the Worker is running. It reads nothing, fetches nothing, and touches no cache, so it costs one object and one JSON.stringify per request and cannot itself be the thing that is broken.
It is referenced from the API catalog as each endpoint's status link. It reports liveness only: it says the Worker answered, not that YouTube is reachable or that any particular route is healthy. Nothing about the request is echoed back, and no environment or configuration value is exposed.
Request
No parameters.
curl "https://burrows.tools/api/health"Responses
Always application/json. Every outcome this endpoint can produce is listed — there is no undocumented fourth thing it does.
200 · health-ok
The Worker is answering.
- Cache-Control:
- no-store
A deployed Worker
{
"status": "ok",
"buildId": "Hs8t2nJqQ1"
}