Chart API
What is Charts API#
As you know, we have charts inside dclist.net. Charts are good for comparing data day by day.
If you haven't seen our charts, they are on any bot's page under "Charts" tab.
The best part about our charts is, you can use them too.
How to use Charts API#
Charts API is simply a rest api witch renders and exports charts for you. It also caches them, so you can access them much quickly.
The base url for Charts API is : https://charts.dclist.net/
Bot Charts#
Bot charts are available under "/bots/$botId/$chartId.$ext" path.
An example bot chart url looks like this : https://charts.dclist.net/bots/690214077490004030/views.svg
Chart Types#
There are two types of public chart you can access via Charts API
Bot Views Chart#
Bot Votes Chart#
File Format#
Charts API supports 3 type of files :
- Scalable Vector Graphics (.svg)
- Portable Network Graphics (.png)
- JavaScript Object Notation (.json)
You can control the file type by changing the extension in the url like views.svg, views.json etc.
Customizing#
You can customize the chart via query strings.
All the query strings are optional.
| Property | Default | Description | Example |
|---|---|---|---|
| width | 1000 | Sets width of the chart | /bots/690214077490004030/views.svg?width=1280 |
| height | 500 | Sets height of the chart | /bots/690214077490004030/views.svg?height=720 |
| theme | dark | Changes the color of texts. dark or light. | /bots/690214077490004030/views.svg?theme=light |
| locale | en | Changes language of the date strings. en or tr. | /bots/690214077490004030/views.svg?locale=tr |
Bot Aliases#
If it has, you can use bots alias as botId.
Like this : https://charts.dclist.net/bots/technobot/views.svg?width=1280&height=720