webdbs

Preview extraction (dry run)

Changed on

Tests extraction on up to 5 URLs without creating a collection. Each URL costs 1 credit.

post/webdbs/preview

Request

  • Base URL
    https://api.context.dev/v1
  • URL
    https://api.context.dev/v1/webdbs/preview
  • Auth
    HTTP bearer

Request body

urlsstring[] required

URLs to test. Maximum 5.

schemaWebdbsSchema required

JSON Schema for the fields extracted into each row. Zod users can pass the output of z.toJSONSchema().

tagsstring[]

Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

Example request

{
  "schema": {
    "type": "object",
    "properties": {
      "title": {
        "type": "string",
        "description": "Product name."
      },
      "price": {
        "type": "number",
        "description": "Current price."
      }
    },
    "required": [
      "title"
    ],
    "additionalProperties": false
  },
  "eligibility": {
    "prefilter": {
      "url_match": [
        "https://shop.com/products/:product_id",
        "https://foo.com/item?id=*",
        "https://foo.com/bar/*",
        "**/events/**"
      ]
    }
  },
  "tags": [
    "production",
    "team-alpha"
  ]
}

Response

Per-URL preview results

Changes

    • warning

      added the new WEBSITE_BLOCKED enum value to the response property for the response status

    • warning

      added the new WEBSITE_BLOCKED enum value to the response property for the response status

    • warning

      added the new COLD_DOMAIN_TIMEOUT_TOO_LOW enum value to the response property for the response status

    • warning

      added the new COLD_DOMAIN_TIMEOUT_TOO_LOW enum value to the response property for the response status