Generate image crops
curl --request POST \
--url https://inference.scrapist.bot/private/crops \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "req_crops_01",
"images": [
"https://assets.example.com/posts/terminal-1.png"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: 'req_crops_01',
images: ['https://assets.example.com/posts/terminal-1.png']
})
};
fetch('https://inference.scrapist.bot/private/crops', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://inference.scrapist.bot/private/crops"
payload = {
"requestId": "req_crops_01",
"images": ["https://assets.example.com/posts/terminal-1.png"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"requestId": "<string>",
"results": [
{
"imageIndex": 1,
"crops": [
{
"source": "prompt_box",
"label": "<string>",
"score": 123,
"x": 1,
"y": 1,
"width": 1,
"height": 1
}
]
}
]
}{
"requestId": "req_01",
"error": {
"code": "invalid_message",
"message": "images must contain at least one non-empty URL"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}Inference
Generate image crops
Find useful regions in one or more images. This route accepts image URLs only; text and event metadata are rejected.
POST
/
private
/
crops
Generate image crops
curl --request POST \
--url https://inference.scrapist.bot/private/crops \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "req_crops_01",
"images": [
"https://assets.example.com/posts/terminal-1.png"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: 'req_crops_01',
images: ['https://assets.example.com/posts/terminal-1.png']
})
};
fetch('https://inference.scrapist.bot/private/crops', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://inference.scrapist.bot/private/crops"
payload = {
"requestId": "req_crops_01",
"images": ["https://assets.example.com/posts/terminal-1.png"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"requestId": "<string>",
"results": [
{
"imageIndex": 1,
"crops": [
{
"source": "prompt_box",
"label": "<string>",
"score": 123,
"x": 1,
"y": 1,
"width": 1,
"height": 1
}
]
}
]
}{
"requestId": "req_01",
"error": {
"code": "invalid_message",
"message": "images must contain at least one non-empty URL"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}{
"requestId": "<string>",
"error": {
"code": "invalid_message",
"message": "<string>"
}
}Authorizations
BearerAuthApiKeyAuth
Your server-side Scrapist API key.
Body
application/json
⌘I