Skip to main content

cURL Examples

Command-line examples for testing the vfrog.ai API with cURL.

Sync Request

curl -X POST https://api.vfrog.ai/v1/cv/requests/sync \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "test-sync-001",
"image_url": "https://example.com/product.jpg"
}'

With Environment Variable

# Set API key
export VFROG_API_KEY="your-api-key-here"

# Make request
curl -X POST https://api.vfrog.ai/v1/cv/requests/sync \
-H "x-api-key: $VFROG_API_KEY" \
-H "Content-Type: application/json" \
-d @request.json

Save Response

curl -X POST https://api.vfrog.ai/v1/cv/requests/sync \
-H "x-api-key: $VFROG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "test-001",
"image_url": "https://example.com/product.jpg"
}' \
-o response.json

# View response
cat response.json | jq '.'

Batch Processing

#!/bin/bash

API_KEY="your-api-key-here"

# Process multiple images with rate limiting (10 requests/minute = 6 seconds between requests)
for i in {1..10}; do
curl -X POST https://api.vfrog.ai/v1/cv/requests/sync \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"external_id\": \"batch-$i\",
\"image_url\": \"https://example.com/image-$i.jpg\"
}"

echo "Submitted request $i"
sleep 6 # Rate limiting (10 requests/minute)
done