Skip to content

Charts




Pie Chart

GET /api/charts/pie_chart
Terminal window
https://api.cookie-api.com/api/charts/pie_chart

URL Parameters
labelsLabels in the pie chart.
sizesSize of each pie slice. Comma-separated list of numerical values.
colors optional Colors of each pie slice. Comma-separated list of color names (e.g., "red", "blue") or hexadecimal color codes (e.g., "#FF5733").
explode optional Separation of a part from the pie chart. Comma-separated list of float values.


example.cURL
curl --location 'https://api.cookie-api.com/api/charts/pie_chart?labels=Label1,Label2,Label3&sizes=30,40,30&colors=red,blue,green&explode=0,0.1,0'

Responses

Pie Chart Example

Pie Chart



Bar Chart

GET /api/charts/bar_chart
Terminal window
https://api.cookie-api.com/api/charts/bar_chart

URL Parameters
labelsLabels for each bar in the chart.
valuesValues corresponding to each bar. Comma-separated list of numerical values.
colors optional Colors for each bar. Comma-separated list of color names (e.g., "red", "blue") or hexadecimal color codes (e.g., "#FF5733").
example.cURL
curl --location 'https://api.cookie-api.com/api/charts/bar_chart?labels=Label1,Label2,Label3&values=10,20,30&colors=red,blue,green'

Responses

Pie Chart Example

Pie Chart



Line Chart


GET /api/charts/line_chart
Terminal window
https://api.cookie-api.com/api/charts/line_chart
URL Parameters
labelsLabels for each data point on the x-axis.
valuesValues corresponding to each data point on the y-axis. Comma-separated list of numerical values.
colors optional Color for the line. Color name (e.g., "red", "blue") or hexadecimal color code (e.g., "#FF5733").


example.cURL
curl --location 'https://api.cookie-api.com/api/charts/line_chart?labels=Label1,Label2,Label3&values=5,10,15&colors=blue'

Responses

Line Chart Example

Line Chart example



Scatter Plot


GET /api/charts/scatter_plot
Terminal window
https://api.cookie-api.com/api/charts/scatter_plot

URL Parameters
x_valuesValues for the x-axis. Comma-separated list of numerical values.
y_valuesValues for the y-axis. Comma-separated list of numerical values.
colors optional Colors for each data point. Comma-separated list of color names (e.g., "red", "blue") or hexadecimal color codes (e.g., "#FF5733").

example.cURL
curl --location 'https://api.cookie-api.com/api/charts/scatter_plot?x_values=1,2,3,4,5&y_values=10,15,20,25,30&colors=red,blue,green,yellow,purple'

Responses

Scatter Plot Example

Scatter Plot


Histogram (Experimental)

GET /api/charts/histogram
Terminal window
https://api.cookie-api.com/api/charts/histogram
URL Parameters
valuesValues to be plotted in the histogram. Comma-separated list of numerical values.
bins optional Number of bins in the histogram. Integer value.
colors optional Color for the histogram bars. Color name (e.g., "red", "blue") or hexadecimal color code (e.g., "#FF5733").


example.cURL
curl --location 'https://api.cookie-api.com/api/charts/histogram?values=10,15,20&bins=3&colors=blue'

Responses

Histogram Example

Histogram