Skip to content


Subversion checkout URL

You can clone with
Download ZIP


gerad edited this page · 34 revisions

Swivel provides a RESTful API interface for charts and data sets.


Swivel’s API is designed to be simple enough that you do not need to use a 3rd party library to access it. However, here are links to a handful of 3rd party libraries that you may choose to use: Java, Ruby, PHP, shell command

Quick Start

Note: it may be necessary to replace the UPPERCASE SECTIONS with appropriate text.

Create a chart in Swivel with the following command.

curl -X POST \
    -F "name=API Chart" \
    -F "data=date,visits
Jun-09,1600" \


Create a chart from a file.

curl -X POST \
    -F "data=<myfile.csv" \

Create a chart from STDIN.

cat myfile.csv | curl -X POST \
    -F "data=<-" \

Replace chart data.

curl -X PUT \
    -F "data=<myfile.csv" \

Note: 123456789 is the id of the chart that you want to update.

Add data to the chart.

curl -X PUT \
    -F "data=<myfile.csv" \
    -F "mode=append" \

Read the chart data.

curl -X GET \

Read the chart meta-data (name, title, formatting information).

curl -X GET \

Delete the chart.

curl -X DELETE \


  1. Chart API

Additional information

The Swivel API is REST based, and supports output in XML, JSON and sometimes CSV.

General guidelines for API calls

All parameters must be sent in UTF-8 and url encoded.

API calls that access private data must be authenticated with your username and password using HTTP basic authentication.

Resource URLs

Every item in Swivel has a unique URL. You can find this URL by going to the item in your web browser and looking at the URL in the address bar. Replace “” in the URL with “” and append .xml or .json to the string.

The curl utility

This documentation uses curl in examples because it is freely available and widely installed, but any similar utility or language library can be used.

The examples use curl with the -k switch because many installations of the curl utility use an outdated list of security certificates. Swivel is secured by Comodo.

cron and crontab

Almost every system includes a scheduling tool such as cron or Windows Task Scheduler.

Once you have a script or tool that updates your data sets, you will probably want to set it to execute on a regular schedule so you and people in your group can concentrate on your numbers.

On many systems, you can edit your crontab file with the command crontab -e and add a line for the script you would like to run.

This example shows a crontab entry that would execute an update script daily at 14:45.

45 14 *  *  * /scripts/

Implementation and policies will vary. Consult the documentation for cron or Task Scheduler for your system.

Rate Limits

Swivel reserves the right to limit API requests should bandwidth exceed a reasonable amount (e.g. 10,000 requests per day).

If you are concerned about volume of API requests that your application may make, please contact Swivel support and we will work to accommodate your requirements.



Representational State Transfer (REST)

Utilities and formats

Something went wrong with that request. Please try again.