JavaScript checker
Submit a JavaScript snippet and receive the identifiers it touched, along with deprecated or removed browser APIs found in the current BCD snapshot.
/api/checkJSON request · 50 KB maximum01 / request
Request body
Send a JSON object with one required field. The checker executes the snippet in its sandbox, so the request body is the only input that affects the scan.
| Field | Type | Required | Constraints |
|---|---|---|---|
| code | string | Yes | At least 1 character and at most 50,000 characters. |
{
"code": "const total = 1;"
}02 / success · 200
Success envelope
A successful scan returns the execution trace and any matching browser-compatibility records. duration_ms and scanned_at are generated for each request.
| Field | Type | Description |
|---|---|---|
| hits | Hit[] | Deprecated or removed APIs found in the executed snippet. |
| touched | string[] | Identifiers observed during execution, including identifiers with no hit. |
| duration_ms | non-negative integer | Sandbox execution duration in milliseconds; generated at request time. |
| scanned_at | ISO date string | Timestamp recorded when the response is assembled. |
| liveBcd | boolean | Whether live BCD enrichment succeeded for this scan. |
| liveRows | LiveRow[] | Live BCD records returned for touched or offline-hit identifiers. |
| liveSource | "mcp" · optional | Present when the live BCD source was used successfully. |
| identifier | Matched API identifier. |
| name | Display name. |
| note | Optional explanation, including live-BCD enrichment notes. |
| browsers | Browser compatibility rows with status, versions, and spec URL. |
| lines | Positive integer source-line numbers where the identifier was touched. |
| handoff | Nullable documentation and inventory handoff metadata. |
| browser | chrome, safari, firefox, or edge. |
| status | deprecated or removed offline; a live row can expose any BCD status string. |
| version_added / removed | Version strings or null. |
| spec_url | URL for an offline compatibility record; live rows use mdn_url. |
| documentationUrl / proveItUrl | Documentation and proof links in a non-null handoff. |
| displayName / inventorySlug | Human label and inventory identifier for the handoff. |
03 / example
A deterministic no-hit scan
const total = 1; touches one ordinary identifier and does not reference a deprecated browser API, so hits and liveRows are empty. The numeric duration and timestamp below are illustrative values generated at request time.
{
"code": "const total = 1;"
}{
"hits": [],
"touched": ["total"],
"duration_ms": 2,
"scanned_at": "2026-09-04T12:34:56.789Z",
"liveBcd": false,
"liveRows": []
}document.write can populate hits. When live BCD enrichment is available, the service may also change the browser rows, add liveRows, and set liveSource to "mcp".04 / errors
Validation and failure responses
| Status | When | Response |
|---|---|---|
400 | Empty code | { "errors": { "code": "Paste some JavaScript to scan" } } |
400 | Code exceeds 50,000 characters | { "errors": { "code": "Paste is over 50 KB — slim it down" } } |
413 | Defensive oversized-payload branch | { "error": "Payload too large" } |
500 | Malformed JSON or unexpected execution failure | { "error": "Internal Server Error" } |
The schema validates the string length before the route reaches its defensive 413 branch, so an ordinary oversized code field returns the 400 field error.
