Skip to content

Latest commit

 

History

History
103 lines (78 loc) · 2.01 KB

API.md

File metadata and controls

103 lines (78 loc) · 2.01 KB

API Documentation

Here's everything you need to know about using the SnipNest API.

🚦 Rate Limit

You can make up to 100 requests per minute. If you go over that, you'll get a 429 error.

🔗 Available Endpoints

Gives you a list of all programming languages we support, as an array of strings.

["string"]

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"]
    }
  }
]

🚨 Errors

Every endpoint which has an error will return an object like this:

{
  "status": 404,
  "message": "Snippet not found."
}