API Reference
API Reference
Endpoint: https://api.singleapi.co/functions/v1/scrape
All the request should be send using the POST
method.
Parameters
url
Type | Required | Default |
---|---|---|
string | true | - |
The URL of the website you want to get data from.
Example: https://news.ycombinator.com/
schemaId
Type | Required | Default |
---|---|---|
UUID | true | - |
Defines the schema ID you want to use to get the data from the website. You can find the schema ID by going to the schemas page and clicking on the schema you want to use.
Example: d9b0c0e0-9f0a-4b0a-9c0a-9f0a8b0c9d0e
maxOutputTokens
Type | Required | Default |
---|---|---|
number | false | 1024 |
The maximum amount of tokens to return. This is useful when you want to get a large amount of data from the website. Maximum value is 8192
.
We recommend to set this value to small number when you are testing your schema. Increasing this value will increase the time it takes to get the data.
Example: 2048
Response
The response will be a JSON object with the following properties:
data
Type |
---|
object |
Object containing the data you requested.
error
Type |
---|
string |
If an error occurred, this property will be set to the error message.