API Reference v1

urltojson REST API

Programmatically transform any target webpage into high-fidelity structured JSON using your saved extractors. Fast, deterministic, and built on high-performance Cloudflare Edge architecture.

Base URL: https://u2j-api.jjajj.xyzFormat: JSONAuth: Bearer u2j_...

Overview & Architecture

The urltojson pipeline consists of three core components:

1

Extractor Template

Defines the schema rules, required fields, and data types (string, number, array) via visual selection or JSON-LD.

2

Edge Fetch Worker

Fetches target HTML with anti-bot resistance, smart headers, and clean DOM deserialization.

3

Extractor Engine

Deterministic hierarchical extraction with microsecond fallback, returning typed JSON payloads.

Authentication

All REST API calls require an API key passed in the standard HTTP Authorization header with the Bearer prefix.

Authorization: Bearer u2j_1234567890abcdef...
Security Tip: Keep your API keys secure. Never expose keys in client-side repositories or public frontends. You can generate, label, and revoke keys at any time from your Dashboard API Keys tab.

Code Examples

POST/v1/extractors/:id/runs

Execute extraction on a given URL using the extractor template specified by :id. Deducts 1 credit upon successful extraction.

Request Body

FieldTypeRequiredDescription
urlstringYesThe full HTTP/HTTPS URL of the target webpage to extract.
Request Example (CURL)
curl -X POST "https://u2j-api.jjajj.xyz/v1/extractors/{EXTRACTOR_ID}/runs" \
  -H "Authorization: Bearer u2j_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/target-article"
  }'

Response Body (200 OK)

{
  "run_id": "run_948a7856-351c-4036-856f-e4ef68d08fd1",
  "status": "success",
  "extractor_id": "71f4d211-936f-45b1-8603-53b3b439c4bf",
  "version": 1,
  "data": {
    "title": "Example Article Headline",
    "author": "Sarah Jenkins",
    "published_at": "2026-09-12T14:30:00Z",
    "content": "Full extracted article content body here..."
  },
  "warnings": [],
  "meta": {
    "method": "fast_jsonld",
    "duration_ms": 138,
    "http_status": 200
  },
  "created_at": "2026-09-14T07:18:50.120Z",
  "updated_at": "2026-09-14T07:18:50.258Z"
}
GET/v1/runs/:id

Retrieve the historical output, execution timing, warnings, and result payload for an existing run by ID.

Request Example (CURL)
curl -X GET "https://u2j-api.jjajj.xyz/v1/runs/{RUN_ID}" \
  -H "Authorization: Bearer u2j_YOUR_API_KEY"
GET/credits

Check current available credits balance for your authenticated account.

curl -X GET "https://u2j-api.jjajj.xyz/credits" \
  -H "Authorization: Bearer u2j_YOUR_API_KEY"
{
  "credits": 20019
}

Error Codes & Responses

urltojson uses conventional HTTP response codes to indicate success or failure.

CodeStatusDescription & Action
200OKExtraction completed successfully. Data payload returned.
400Bad RequestMissing required parameters (e.g. target URL not provided).
401UnauthorizedInvalid or missing API key in the Authorization header.
402Payment RequiredInsufficient credits. Top up via Dashboard or Pricing page.
404Not FoundThe specified extractor ID or run ID does not exist.
422Unprocessable EntityTarget website blocked access or required fields were absent. No credits deducted.
500Internal Server ErrorAn internal error occurred. Please retry or contact support.

API Usage & Credits

Credit Usage

  • • One credit per successful extraction
  • • Failed or blocked extractions do not consume credits
  • • HTTP 429 when your credit balance is exhausted

Starter & Growth

  • • One-time purchases of 10,000 or 35,000 credits
  • • Full REST API access and API key management
  • • Save and reuse extractors in your dashboard

Developer Community & Support

Need help crafting custom extraction schemas, reporting anti-bot hurdles, or suggesting features? Connect with our team and community directly!