cURL / HTTP
Direct REST API usage examples
Use the Refyne API directly with cURL or any HTTP client.
Base URL
https://api.refyne.ukAuthentication
Include your API key in the Authorization header:
-H "Authorization: Bearer YOUR_API_KEY"Extract
Extract data from a single page:
curl -X POST https://api.refyne.uk/api/v1/extract \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://demo.refyne.uk/products/5",
"schema": {
"name": "string",
"brand": "string",
"price": "number",
"in_stock": "boolean"
}
}'Crawl
Start a multi-page crawl job:
curl -X POST https://api.refyne.uk/api/v1/crawl \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://demo.refyne.uk/products",
"schema": {
"name": "string",
"price": "number"
},
"options": {
"follow_pattern": "/products/[0-9]+",
"max_pages": 10
}
}'Check Job Status
curl https://api.refyne.uk/api/v1/jobs/JOB_ID \
-H "Authorization: Bearer YOUR_API_KEY"Get Job Results
# Individual results
curl https://api.refyne.uk/api/v1/jobs/JOB_ID/results \
-H "Authorization: Bearer YOUR_API_KEY"
# Merged results
curl "https://api.refyne.uk/api/v1/jobs/JOB_ID/results?merge=true" \
-H "Authorization: Bearer YOUR_API_KEY"Analyze Site
curl -X POST https://api.refyne.uk/api/v1/analyze \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://demo.refyne.uk",
"depth": 1
}'API Keys
List your API keys:
curl https://api.refyne.uk/api/v1/keys \
-H "Authorization: Bearer YOUR_API_KEY"Create a new API key:
curl -X POST https://api.refyne.uk/api/v1/keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production Key"
}'Error Responses
Errors return JSON with an error field:
{
"error": "Invalid API key",
"status": 401
}Rate Limits
Rate limit info is returned in response headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1705312800For full API reference, see the API Reference.