curl --request POST \
--url https://shelfforce.ai/api/v1/analyses/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
{
"imageUrl": "https://cdn.example.com/shelf-photo-001.jpg",
"placeId": "pl_abc123",
"taskId": "tsk_xyz789",
"externalId": "customer-123",
"metadata": {
"store": "store-42",
"aisle": "3"
}
}
],
"callbackUrl": "https://your-app.com/callbacks/shelfforce"
}
'import requests
url = "https://shelfforce.ai/api/v1/analyses/batch"
payload = {
"images": [
{
"imageUrl": "https://cdn.example.com/shelf-photo-001.jpg",
"placeId": "pl_abc123",
"taskId": "tsk_xyz789",
"externalId": "customer-123",
"metadata": {
"store": "store-42",
"aisle": "3"
}
}
],
"callbackUrl": "https://your-app.com/callbacks/shelfforce"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
images: [
{
imageUrl: 'https://cdn.example.com/shelf-photo-001.jpg',
placeId: 'pl_abc123',
taskId: 'tsk_xyz789',
externalId: 'customer-123',
metadata: {store: 'store-42', aisle: '3'}
}
],
callbackUrl: 'https://your-app.com/callbacks/shelfforce'
})
};
fetch('https://shelfforce.ai/api/v1/analyses/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shelfforce.ai/api/v1/analyses/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'images' => [
[
'imageUrl' => 'https://cdn.example.com/shelf-photo-001.jpg',
'placeId' => 'pl_abc123',
'taskId' => 'tsk_xyz789',
'externalId' => 'customer-123',
'metadata' => [
'store' => 'store-42',
'aisle' => '3'
]
]
],
'callbackUrl' => 'https://your-app.com/callbacks/shelfforce'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://shelfforce.ai/api/v1/analyses/batch"
payload := strings.NewReader("{\n \"images\": [\n {\n \"imageUrl\": \"https://cdn.example.com/shelf-photo-001.jpg\",\n \"placeId\": \"pl_abc123\",\n \"taskId\": \"tsk_xyz789\",\n \"externalId\": \"customer-123\",\n \"metadata\": {\n \"store\": \"store-42\",\n \"aisle\": \"3\"\n }\n }\n ],\n \"callbackUrl\": \"https://your-app.com/callbacks/shelfforce\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://shelfforce.ai/api/v1/analyses/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n {\n \"imageUrl\": \"https://cdn.example.com/shelf-photo-001.jpg\",\n \"placeId\": \"pl_abc123\",\n \"taskId\": \"tsk_xyz789\",\n \"externalId\": \"customer-123\",\n \"metadata\": {\n \"store\": \"store-42\",\n \"aisle\": \"3\"\n }\n }\n ],\n \"callbackUrl\": \"https://your-app.com/callbacks/shelfforce\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://shelfforce.ai/api/v1/analyses/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"images\": [\n {\n \"imageUrl\": \"https://cdn.example.com/shelf-photo-001.jpg\",\n \"placeId\": \"pl_abc123\",\n \"taskId\": \"tsk_xyz789\",\n \"externalId\": \"customer-123\",\n \"metadata\": {\n \"store\": \"store-42\",\n \"aisle\": \"3\"\n }\n }\n ],\n \"callbackUrl\": \"https://your-app.com/callbacks/shelfforce\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"analyses": [
{
"id": "an_g7h8j9k0",
"imageUrl": "https://cdn.example.com/shelf-photo-001.jpg",
"status": "processing"
}
],
"creditsConsumed": 3
}
}{
"error": {
"code": "INVALID_API_KEY",
"message": "The provided API key is invalid or has been revoked."
}
}{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "You need 3 credits but only have 1 remaining.",
"details": {
"creditsRequired": 3,
"creditsRemaining": 1
}
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "The 'imageUrl' field must be a valid URL."
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 12 seconds."
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred. Please try again or contact support with request ID."
}
}Batch submit
Submits multiple images for shelf analysis in a single request. Each image consumes 1 credit. Maximum batch size depends on your plan tier (20-200). All analyses run asynchronously.
curl --request POST \
--url https://shelfforce.ai/api/v1/analyses/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
{
"imageUrl": "https://cdn.example.com/shelf-photo-001.jpg",
"placeId": "pl_abc123",
"taskId": "tsk_xyz789",
"externalId": "customer-123",
"metadata": {
"store": "store-42",
"aisle": "3"
}
}
],
"callbackUrl": "https://your-app.com/callbacks/shelfforce"
}
'import requests
url = "https://shelfforce.ai/api/v1/analyses/batch"
payload = {
"images": [
{
"imageUrl": "https://cdn.example.com/shelf-photo-001.jpg",
"placeId": "pl_abc123",
"taskId": "tsk_xyz789",
"externalId": "customer-123",
"metadata": {
"store": "store-42",
"aisle": "3"
}
}
],
"callbackUrl": "https://your-app.com/callbacks/shelfforce"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
images: [
{
imageUrl: 'https://cdn.example.com/shelf-photo-001.jpg',
placeId: 'pl_abc123',
taskId: 'tsk_xyz789',
externalId: 'customer-123',
metadata: {store: 'store-42', aisle: '3'}
}
],
callbackUrl: 'https://your-app.com/callbacks/shelfforce'
})
};
fetch('https://shelfforce.ai/api/v1/analyses/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shelfforce.ai/api/v1/analyses/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'images' => [
[
'imageUrl' => 'https://cdn.example.com/shelf-photo-001.jpg',
'placeId' => 'pl_abc123',
'taskId' => 'tsk_xyz789',
'externalId' => 'customer-123',
'metadata' => [
'store' => 'store-42',
'aisle' => '3'
]
]
],
'callbackUrl' => 'https://your-app.com/callbacks/shelfforce'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://shelfforce.ai/api/v1/analyses/batch"
payload := strings.NewReader("{\n \"images\": [\n {\n \"imageUrl\": \"https://cdn.example.com/shelf-photo-001.jpg\",\n \"placeId\": \"pl_abc123\",\n \"taskId\": \"tsk_xyz789\",\n \"externalId\": \"customer-123\",\n \"metadata\": {\n \"store\": \"store-42\",\n \"aisle\": \"3\"\n }\n }\n ],\n \"callbackUrl\": \"https://your-app.com/callbacks/shelfforce\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://shelfforce.ai/api/v1/analyses/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n {\n \"imageUrl\": \"https://cdn.example.com/shelf-photo-001.jpg\",\n \"placeId\": \"pl_abc123\",\n \"taskId\": \"tsk_xyz789\",\n \"externalId\": \"customer-123\",\n \"metadata\": {\n \"store\": \"store-42\",\n \"aisle\": \"3\"\n }\n }\n ],\n \"callbackUrl\": \"https://your-app.com/callbacks/shelfforce\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://shelfforce.ai/api/v1/analyses/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"images\": [\n {\n \"imageUrl\": \"https://cdn.example.com/shelf-photo-001.jpg\",\n \"placeId\": \"pl_abc123\",\n \"taskId\": \"tsk_xyz789\",\n \"externalId\": \"customer-123\",\n \"metadata\": {\n \"store\": \"store-42\",\n \"aisle\": \"3\"\n }\n }\n ],\n \"callbackUrl\": \"https://your-app.com/callbacks/shelfforce\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"analyses": [
{
"id": "an_g7h8j9k0",
"imageUrl": "https://cdn.example.com/shelf-photo-001.jpg",
"status": "processing"
}
],
"creditsConsumed": 3
}
}{
"error": {
"code": "INVALID_API_KEY",
"message": "The provided API key is invalid or has been revoked."
}
}{
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "You need 3 credits but only have 1 remaining.",
"details": {
"creditsRequired": 3,
"creditsRemaining": 1
}
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "The 'imageUrl' field must be a valid URL."
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 12 seconds."
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred. Please try again or contact support with request ID."
}
}Authorizations
API key with sf_live_ prefix. Pass as Authorization: Bearer sf_live_...
Headers
Unique key for idempotent requests. If a request with the same key was already processed within the last 24 hours, the cached response is returned with X-Idempotent-Replayed: true.
"idk_550e8400-e29b-41d4-a716-446655440000"
Body
Array of image submissions. Max size depends on your plan tier (20-200). Check GET /api/v1/usage for your maxBatchSize.
1Show child attributes
Show child attributes
HTTPS URL to receive a signed POST when each analysis completes or fails. A callbackSecret is returned per analysis for signature verification.
"https://your-app.com/callbacks/shelfforce"
Response
Batch accepted. All analyses are queued.
Show child attributes
Show child attributes