API Documentation

Extract structured data from any webpage with a single API call.

Authentication

All requests require a Bearer token in the Authorization header.

Authorization: Bearer YOUR_API_KEY

Get your API key from Developer Settings.

Endpoint

GET /a/{user_id}/{api_slug}?url={target_url}

Parameters

Name Type Description
user_id path Your user ID
api_slug path The API identifier
url query Target URL to extract data from (URL-encoded)
fresh query optional Set to true to bypass cache and fetch live data

Responses

200 Success

Data extracted successfully. Returns the extracted data with metadata.

202 Building

Parser is being generated for this domain. Retry after the specified delay. Check the Retry-After header.

4xx/5xx Error

All errors return a consistent format with machine-readable codes.

Error Codes

Code Status Description
missing_api_key 401 No API key provided
invalid_api_key 401 API key is invalid
subscription_required 402 No active subscription
quota_exceeded 429 Monthly quota exceeded
not_found 404 API not found
parse_failed 422 Could not extract data
timeout 504 Request timed out

Caching

Layer TTL Description
Page Content 10 min HTML from target URLs
Fetch Method 7 days HTTP vs browser rendering per domain
Parsers Permanent Generated extraction code
Need live data? Add fresh=true to bypass the page cache.

Rate Limits

  • Monthly Quota: Based on your subscription plan
  • Overage: $0.005/request (if metered billing enabled)
  • Timeout: 115 seconds max per request
Enable metered billing to continue past your quota with overage charges.

Code Examples

Request
curl -X GET \
  "https://kravla.com/a/USER_ID/my-api?url=https://example.com/page" \
  -H "Authorization: Bearer YOUR_API_KEY"
200 Success Response
{
  "data": {
    "title": "Example Product",
    "price": 29.99,
    "currency": "USD"
  },
  "url": "https://example.com/product/123",
  "api": "product-extractor",
  "metadata": {
    "api_id": "550e8400-...",
    "parser_id": "6ba7b810-...",
    "domain": "example.com"
  }
}
202 Building Response
{
  "status": "building",
  "message": "Parser is being generated",
  "domain": "newsite.com",
  "retry_after_seconds": 120
}
4xx Error Response
{
  "error": "quota_exceeded",
  "message": "Monthly quota exceeded",
  "hint": "Enable metered billing",
  "quota": 1000,
  "used": 1050
}