Skip to main content

API Overview

The img-src API allows you to upload, transform, and manage images programmatically. All API endpoints are available at https://api.img-src.io.

Base URL

https://api.img-src.io

Authentication

All API endpoints (except /health) require authentication using an API key.

Getting an API Key

  1. Sign in to your dashboard
  2. Go to Settings
  3. Click Create API Key
  4. Copy the key immediately (it won’t be shown again)

Using Your API Key

Include your API key in the Authorization header:
curl https://api.img-src.io/api/v1/images \
  -H "Authorization: Bearer imgsrc_YOUR_API_KEY"
API keys start with imgsrc_ prefix. Keep them secure and never expose them in client-side code.

Rate Limiting

Rate limits are applied per API key:
PlanRequests/Minute
Free100
Pro500
Rate limit information is included in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1704067260
When rate limited, you’ll receive a 429 Too Many Requests response.

Response Format

All responses are JSON. Successful responses return the requested data:
{
  "id": "img_abc123",
  "url": "https://img-src.io/i/username/photo.jpg",
  ...
}
Error responses follow a consistent format:
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Image not found",
    "status": 404
  }
}

Common Error Codes

CodeStatusDescription
UNAUTHORIZED401Missing or invalid API key
FORBIDDEN403Insufficient permissions
NOT_FOUND404Resource not found
VALIDATION_ERROR400Invalid request parameters
RATE_LIMITED429Too many requests
INTERNAL_ERROR500Server error

Pagination

List endpoints support pagination with limit and offset parameters:
curl "https://api.img-src.io/api/v1/images?limit=20&offset=40" \
  -H "Authorization: Bearer imgsrc_YOUR_API_KEY"
Paginated responses include total count:
{
  "images": [...],
  "total": 150,
  "limit": 20,
  "offset": 40
}

CDN URLs

After uploading, images are served via CDN:
  • Primary: https://img-src.io/i/{username}/{path}
  • Secondary: https://cdn.img-src.io/{username}/{path}
Both URLs support the same transformation parameters.

API Endpoints