POST
/
api
/
ai

Authorizations

Authorization
string
headerrequired

You can retrieve your token by visiting the API Tokens section inside your profile page or see https://docs.mrscraper.com/documentation/api-token for the details.

Body

application/json
urls
string[]
required

List of urls being scraped

schema
object
required

Defines how the AI will structure and return the scraped results. The result will be formatted according to this schema. The schema follows the rules defined in https://json-schema.org/. If the type is 'object', the 'properties' field is required. If the type is 'array', the 'items' field is required.

min
integer
default: 10

The minimum number of data items you want for each URL scraped. For example, if min: 100, but only 10 data items are available on the web, it will return 10 items, not 100. This ensures you get as much data as possible without causing errors when less data is available than requested.

Required range: x > 1
max
integer
default: 20

The maximum number of data items you want for each URL scraped. For example, if max: 100 and the data in the URL contains 200 items, it will return only 100. This allows you to limit the amount of data retrieved to manage processing time and resource usage.

Required range: x > 1
timeout
integer
default: 180

Scraping timeout in seconds. If it runs beyond the time limit, it will stop scraping and return the successfully scraped data.

Required range: 60 < x < 600

Response

200 - application/json
result
any

The scraped data according to the provided schema.

tokenUsage
integer

The number of token usage during scraping.

totalDone
integer

The number of URLs successfully scraped.