Skip to main content

REST API Overview

The Meter REST API provides direct HTTP access to all Meter features. Use it when the Python SDK isn’t available or when you need language-agnostic integration.

Base URL

https://api.meter.sh
All API requests should be made to this base URL.

Authentication

Include your API key in the Authorization header using the Bearer scheme:
curl https://api.meter.sh/v1/strategies \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -H "Content-Type: application/json"
See Authentication for details.

Request format

All POST and PATCH requests must include Content-Type: application/json and send JSON-encoded request bodies. Example:
curl -X POST https://api.meter.sh/v1/strategies/generate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "description": "Extract product names and prices",
    "name": "Product Scraper"
  }'

Response format

All responses are JSON-encoded with appropriate HTTP status codes:
  • 200 OK: Successful request
  • 201 Created: Resource created successfully
  • 400 Bad Request: Invalid request parameters
  • 401 Unauthorized: Invalid or missing API key
  • 404 Not Found: Resource not found
  • 500 Internal Server Error: Server error
Success response:
{
  "strategy_id": "550e8400-e29b-41d4-a716-446655440000",
  "strategy": {...},
  "preview_data": [...]
}
Error response:
{
  "detail": "Error message describing what went wrong"
}

API endpoints

Strategies

MethodEndpointDescription
POST/v1/strategies/generateGenerate a new strategy
POST/v1/strategies/{id}/refineRefine an existing strategy
GET/v1/strategiesList all strategies
GET/v1/strategies/{id}Get strategy details
DELETE/v1/strategies/{id}Delete a strategy

Jobs

MethodEndpointDescription
POST/v1/jobsCreate a new job
GET/v1/jobs/{id}Get job status and results
GET/v1/jobsList jobs (with filtering)
POST/v1/jobs/compareCompare two jobs
GET/v1/strategies/{id}/historyGet strategy job history

Schedules

MethodEndpointDescription
POST/v1/schedulesCreate a schedule
GET/v1/schedulesList all schedules
PATCH/v1/schedules/{id}Update a schedule
DELETE/v1/schedules/{id}Delete a schedule
GET/v1/schedules/{id}/changesGet unseen changes
See detailed endpoint documentation:

Rate limiting

Rate limits are not yet enforced during beta. Reasonable usage is expected.
Future rate limits will include headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

Pagination

List endpoints support pagination with limit and offset query parameters:
# Get first 20 results
curl "https://api.meter.sh/v1/strategies?limit=20&offset=0" \
  -H "Authorization: Bearer sk_live_..."

# Get next 20 results
curl "https://api.meter.sh/v1/strategies?limit=20&offset=20" \
  -H "Authorization: Bearer sk_live_..."

Idempotency

POST requests are not idempotent—calling the same endpoint twice will create two resources. For idempotent operations, use the Python SDK or implement your own idempotency logic.

CORS

The API does not currently support CORS. For browser-based applications, proxy requests through your backend.

Webhooks

Configure webhooks when creating schedules to receive real-time notifications:
curl -X POST https://api.meter.sh/v1/schedules \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "strategy_id": "550e8400-e29b-41d4-a716-446655440000",
    "url": "https://example.com/products",
    "interval_seconds": 3600,
    "webhook_url": "https://your-app.com/webhooks/meter"
  }'
See the Webhooks Guide for implementation details.

Next steps

Need help?

Email me at [email protected]