Skip to main content

Data

These are the docs for the data endpoints. Used for getting info about languages and the number of active pastes.

V2 language names are accepted, and where V3 renamed a language the V2 name is returned (for example Plain Text instead of Text). See the differences from the original V2.

Get a language by name​

Get the language information for a specific language. Note that the language name must be percent encoded.

GET /api/v2/data/language?name=:languageName
Response​
{
"name": "C",
"mode": "clike",
"mimes": [
"text/x-csrc"
],
"ext": [
"c",
"cats",
"h",
"idc"
],
"color": "#555555"
}
Errors​
  • 404 with "The language was not found." if there's no such language

Get a language by extension​

Get the language information for a specific language.

GET /api/v2/data/languageExt?extension=:languageExtension

The extension is given without the leading dot, for example ?extension=c.

Response​
{
"name": "C",
"mode": "clike",
"mimes": [
"text/x-csrc"
],
"ext": [
"c",
"cats",
"h",
"idc"
],
"color": "#555555"
}
Errors​
  • 404 with "The language was not found." if no language has this extension

Get the number of currently active pastes​

Returns the number of currently active pastes, including encrypted pastes.

GET /api/v2/data/numPastes
Response​
{
"numPastes": 111
}