Data Sources

API Overview

Introduction to the ChartPuppy REST API for programmatic chart generation.

API Overview

The ChartPuppy API lets you create, update, and retrieve charts programmatically. Build charts into your applications, automate workflows, or integrate with your data pipeline.

Base URL

All API requests use the following base URL:

https://api.chartpuppy.com/v1

Authentication

Authenticate using an API key in the request header:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.chartpuppy.com/v1/charts

Get your API key from Settings → API Keys in your dashboard.

Rate Limits

Plan Requests/minute Requests/day
Free 10 100
Pro 60 5,000
Team 300 50,000

Rate limit headers are included in every response:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1704067200

Response Format

All responses are JSON. Successful responses include the data directly:

{
  "id": "chart_abc123",
  "title": "Monthly Sales",
  "url": "https://chartpuppy.com/c/abc123",
  "image_url": "https://chartpuppy.com/c/abc123.png",
  "created_at": "2024-01-15T10:30:00Z"
}

Error responses include an error object:

{
  "error": {
    "code": "invalid_request",
    "message": "Missing required field: data"
  }
}

Quick Example

Create a simple bar chart:

curl -X POST https://api.chartpuppy.com/v1/charts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "bar",
    "title": "Q1 Sales",
    "data": {
      "labels": ["Jan", "Feb", "Mar"],
      "datasets": [{
        "label": "Revenue",
        "data": [12000, 18500, 21000]
      }]
    }
  }'

Endpoints

Method Endpoint Description
GET /charts List all charts
POST /charts Create a new chart
GET /charts/:id Get chart details
PATCH /charts/:id Update a chart
DELETE /charts/:id Delete a chart
POST /charts/:id/regenerate Regenerate chart image

See individual endpoint documentation for details: