trueparse

Scrape

Batch Scrape

Scrape a batch of webpages (Asynchronous)

POST
/v0/scrape/batch

Request Body

application/jsonRequired
webhookUrl?Webhookurl | null

The URL to send the response to.

pagesPages

Header Parameters

authorization?Authorization | null

Response Body

Successful Response

TypeScript Definitions

Use the response body type in TypeScript.

requestIdRequestid
Format"uuid"

Validation Error

TypeScript Definitions

Use the response body type in TypeScript.

detail?Detail
curl -X POST "https://example.com/v0/scrape/batch" \
  -H "authorization: string" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookUrl": "http://example.com",
    "pages": [
      {
        "includeLinks": true,
        "outputs": [
          "markdown",
          "image"
        ],
        "schema": {
          "properties": {
            "id": {
              "type": "integer"
            },
            "name": {
              "type": "string"
            },
            "price": {
              "type": "number"
            }
          },
          "type": "object"
        },
        "url": "https://example.com"
      }
    ]
  }'
const body = JSON.stringify({
  "webhookUrl": "http://example.com",
  "pages": [
    {
      "includeLinks": true,
      "outputs": [
        "markdown",
        "image"
      ],
      "schema": {
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "url": "https://example.com"
    }
  ]
})

fetch("https://example.com/v0/scrape/batch", {
  headers: {
    "authorization": "string"
  },
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://example.com/v0/scrape/batch"
  body := strings.NewReader(`{
    "webhookUrl": "http://example.com",
    "pages": [
      {
        "includeLinks": true,
        "outputs": [
          "markdown",
          "image"
        ],
        "schema": {
          "properties": {
            "id": {
              "type": "integer"
            },
            "name": {
              "type": "string"
            },
            "price": {
              "type": "number"
            }
          },
          "type": "object"
        },
        "url": "https://example.com"
      }
    ]
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("authorization", "string")
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/v0/scrape/batch"
body = {
  "webhookUrl": "http://example.com",
  "pages": [
    {
      "includeLinks": true,
      "outputs": [
        "markdown",
        "image"
      ],
      "schema": {
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "url": "https://example.com"
    }
  ]
}
response = requests.request("POST", url, json = body, headers = {
  "authorization": "string",
  "Content-Type": "application/json"
})

print(response.text)
{
  "requestId": "d385ab22-0f51-4b97-9ecd-b8ff3fd4fcb6"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}