The base endpoint for the api is https://api.snip.tf/
.
The API has no headers/authentication and is rate limited to 5 requests per second. After exceeding the rate limit your requests will get a 429 (too many requests) response code. If you need to do more requests than that contact me.
The endpoint for creating and fetching snips.
GET https://api.snip.tf/snips/get/{_id}
This returns a full snip object.
POST https://api.snip.tf/snips/create
JSON body:
Field | Type | Optional | Description |
---|---|---|---|
title | string | ✅ | Title of the snip. |
snips | Snip[] | ❌ | Code files. |
Check out the snip object.
Note: all the IDs are auto-generated.
Field | Type | Description |
---|---|---|
_id | string | The snip's identifier. |
title | string | Title of the snip. |
snips | Snip[] | List of files in the snip. |
Field | Type | Description |
---|---|---|
_id | string | The individual snippet's identifier. |
title | string | The file name. |
content | string | Contents of the snip. |
language | string | Language of the snip. Must be in a valid format. |