{
  "openapi": "3.0.1",
  "info": {
    "title": "Chart Image API - Data to PNG/SVG Chart for Agents & Reports",
    "description": "Need a chart image, not a library? Send JSON rows, a Chart.js or Vega-Lite spec, or any dataset ID and get a PNG and SVG with a public link in the key-value store. Pay per chart, no browser, no monthly plan. Good for Slack, email and PDF reports.",
    "version": "1.0",
    "x-build-id": "dYZJgP5pBg2mXWzAK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/that_red_bird~chart-image-generator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-that_red_bird-chart-image-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/that_red_bird~chart-image-generator/runs": {
      "post": {
        "operationId": "runs-sync-that_red_bird-chart-image-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/that_red_bird~chart-image-generator/run-sync": {
      "post": {
        "operationId": "run-sync-that_red_bird-chart-image-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "data": {
            "title": "Data rows",
            "type": "array",
            "description": "Simple mode: a list of JSON objects, one per category or point, for example [{\"month\":\"Jan\",\"sales\":10},{\"month\":\"Feb\",\"sales\":14}]. The first column is the x axis and numeric columns become the values. Leave empty (with no spec and no dataset) to render three demo charts.",
            "default": []
          },
          "chartType": {
            "title": "Chart type",
            "enum": [
              "bar",
              "horizontalBar",
              "line",
              "area",
              "pie",
              "doughnut",
              "scatter"
            ],
            "type": "string",
            "description": "Chart type for simple mode and dataset mode. Ignored when you pass a spec.",
            "default": "bar"
          },
          "title": {
            "title": "Chart title",
            "type": "string",
            "description": "Title drawn above the chart. Leave empty for no title.",
            "default": ""
          },
          "xField": {
            "title": "X field (category column)",
            "type": "string",
            "description": "Name of the column for the x axis or the pie slices. Leave empty to use the first column of the data.",
            "default": ""
          },
          "yFields": {
            "title": "Value fields",
            "type": "array",
            "description": "Names of the numeric columns to plot. Several columns draw several series. Leave empty to use every numeric column except the x field.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "seriesField": {
            "title": "Series field (optional)",
            "type": "string",
            "description": "Name of a column that splits one value column into coloured series, for example region or product. Use it when your rows are in long format.",
            "default": ""
          },
          "stacked": {
            "title": "Stack series",
            "type": "boolean",
            "description": "Stack bars or areas of several series on top of each other. When off, bars of several series are drawn side by side.",
            "default": true
          },
          "spec": {
            "title": "Chart.js config or Vega-Lite spec",
            "type": "object",
            "description": "Advanced: a full Chart.js config ({type, data:{labels, datasets}, options}) rendered to PNG, or a Vega-Lite spec rendered to PNG and SVG. Plain JSON only, no functions. Leave empty for simple mode.",
            "default": {}
          },
          "datasetId": {
            "title": "Dataset to chart (optional)",
            "type": "string",
            "description": "Pick any dataset, for example the output of another Actor, to chart its rows. Use X field and Value fields to map columns. The first rows (see Max rows) are used."
          },
          "charts": {
            "title": "Several charts at once",
            "type": "array",
            "description": "Advanced: a list of chart jobs, each with the same fields as above (name, chartType, data, spec, title, xField, yFields, seriesField, stacked, width, height, theme, formats). One image set is rendered and charged per job.",
            "default": []
          },
          "width": {
            "title": "Width (px)",
            "minimum": 200,
            "maximum": 2400,
            "type": "integer",
            "description": "Chart width in pixels, 200 to 2400. Vega-Lite and simple charts are also multiplied by Scale.",
            "default": 900
          },
          "height": {
            "title": "Height (px)",
            "minimum": 150,
            "maximum": 1800,
            "type": "integer",
            "description": "Chart height in pixels, 150 to 1800.",
            "default": 520
          },
          "scale": {
            "title": "PNG scale",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Pixel density multiplier for the PNG of simple and Vega-Lite charts (2 gives sharp images for retina and PDF). Not used for Chart.js specs.",
            "default": 2
          },
          "theme": {
            "title": "Theme",
            "enum": [
              "light",
              "dark"
            ],
            "type": "string",
            "description": "Light or dark colours for background, text and grid.",
            "default": "light"
          },
          "formats": {
            "title": "Output formats",
            "type": "array",
            "description": "Which images to store. SVG is available for simple and Vega-Lite charts only. Both formats count as one chart.",
            "items": {
              "type": "string",
              "enum": [
                "png",
                "svg"
              ],
              "enumTitles": [
                "PNG",
                "SVG"
              ]
            },
            "default": [
              "png",
              "svg"
            ]
          },
          "maxRows": {
            "title": "Max rows per chart",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Rows beyond this number are ignored, to keep charts readable and runs fast.",
            "default": 1000
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}