Pixela API Document

API Document for Pixela ( https://pixe.la/ ) .

GET - /v1/users/<username>/graphs/<graphID>

Description

Based on the registered information, express the graph in SVG format diagram.

Help page

Graph - Pixela Help Center

HTTP Method , API endpoint

GET /v1/users/<username>/graphs/<graphID>

Query Parameter

Key Type Description
date string [optional] If you specify it in yyyyMMdd format, will create a pixelation graph dating back to the past with that day as the start date.
If this parameter is not specified, the current date and time will be the start date.
(it is used timezone setting if Graph's timezone is specified, if not specified, calculates it in UTC)
mode string [optional] Specify the graph display mode.
Supported modes are short (for displaying only about 90 days), badge (Badge format pasted on GitHub README. Information for the last 49 days is expressed in 7 pixels.), and line .
appearance string [optional] If you want a dark image that matches the dark theme, specify dark.
You can use this option with mode=short and mode=line.

Specification

  • If publishOptionalData property of Graph is true, each pixel's optionalData will be added to the generated SVG data as a data-optional attribute.
    • On the other hand, be careful because the data-tippy-content attribute is removed.
    • This feature is limited for Pixela Supporter. About Pixela Supporter , please check [How to support Pixela by Patreon / Use Limited Features] .

Possible errors by HTTP response status code

  • 400 Bad Request
    • This is an error if there is some mistake in your request. Unless the mistake is corrected, the request will not succeed.
  • 404 Not Found
    • This error occurs when your request destination does not exist.
    • This error also occurs when authentication to the request destination is not successful.
  • 500 Internal Server Error
    • Status in the event of an unexpected error. Retrying the request may be successfully processed.

Example

$ curl -X GET https://pixe.la/v1/users/a-know/graphs/test-graph?date=20180331&mode=short&appearance=dark
<svg xmlns="http://www.w3.org/2000/svg" width="220" height="135" ...