Here's everything you need to know about using the SnipNest API.
You can make up to 100 requests per minute. If you go over that, you'll get a 429 error.
GET
/api/languages
Gives you a list of all programming languages we support, as an array of strings.
["string"]
GET
/api/[language]
Shows you all categories for a specific language, as an array of strings.
["string"]
Lists all snippets in a category.
[
{
"language": "string",
"category": "string",
"name": "string",
"metadata": {
"name": "string",
"description": "string",
"keywords": ["string"],
"contributors": ["string"]
}
}
]
Returns a single snippet with all its details.
{
"language": "string",
"category": "string",
"name": "string",
"metadata": {
"name": "string",
"description": "string",
"keywords": ["string"],
"contributors": ["string"]
}
}
Just the code, nothing else.
function delay(ms: number): Promise<void> {
...
Find snippets across the whole site. Works with names, descriptions, and keywords.
[
{
"language": "string",
"category": "string",
"name": "string",
"metadata": {
"name": "string",
"description": "string",
"keywords": ["string"],
"contributors": ["string"]
}
}
]
Every endpoint which has an error will return an object like this:
{
"status": 404,
"message": "Snippet not found."
}