katsau Docs
POST/v1/extract/batch

Extract metadata from multiple URLs in a single request.

Request Body

NameTypeRequiredDefaultDescription
urlsstring[]-Array of URLs to extract metadata from
cachebooleantrueWhether to use cached results if available

Batch Limits by Plan

PlanURLs per Request
Free5
Starter10
Pro25
Business50
Enterprise100

Request Example

curl -X POST "https://api.katsau.com/v1/extract/batch" \
  -H "Authorization: Bearer ks_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://github.com",
      "https://twitter.com",
      "https://dev.to"
    ],
    "cache": true
  }'

Response

{
  "success": true,
  "data": {
    "results": [
      {
        "url": "https://github.com",
        "success": true,
        "data": {
          "title": "GitHub: Let's build from here",
          "description": "GitHub is where over 100 million developers...",
          "image": "https://github.githubassets.com/...",
          "open_graph": { ... },
          "twitter": { ... }
        },
        "cache_hit": true
      },
      {
        "url": "https://twitter.com",
        "success": true,
        "data": { ... },
        "cache_hit": false
      },
      {
        "url": "https://invalid-url.xyz",
        "success": false,
        "error": {
          "code": "TARGET_UNREACHABLE",
          "message": "Could not reach the target URL"
        }
      }
    ],
    "summary": {
      "total": 3,
      "successful": 2,
      "failed": 1
    }
  },
  "meta": {
    "request_id": "req_abc123xyz",
    "response_time_ms": 1245
  }
}

Handling Partial Failures

Batch requests may have partial failures. The overall request succeeds (HTTP 200), but individual URLs may fail. Check the success field for each result.

const { data } = await response.json();

for (const result of data.results) {
  if (result.success) {
    console.log(`✓ ${result.url}: ${result.data.title}`);
  } else {
    console.log(`✗ ${result.url}: ${result.error.message}`);
  }
}

console.log(`Summary: ${data.summary.successful}/${data.summary.total} successful`);

Error Codes

CodeHTTPDescription
BATCH_TOO_LARGE400Too many URLs for your plan
INVALID_BODY400Request body is not valid JSON
INVALID_URL400One or more URLs are invalid