Documentation/API Reference

API Reference

Complete API documentation for integrating Snippet Manager into your applications.

REST APIv2.0Rate Limited
Authentication

API Key Authentication

All API requests require authentication using your API key in the Authorization header.

Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \
     https://api.Snippet Manager.com/v2/snippets

Getting Your API Key

  1. Go to your account settings
  2. Navigate to the "API Keys" section
  3. Click "Generate New Key"
  4. Copy and securely store your key
Snippets API

Manage your code snippets programmatically.

GET/v2/snippets

Retrieve all snippets for the authenticated user.

Query Parameters

  • page - Page number (default: 1)
  • limit - Items per page (default: 20, max: 100)
  • language - Filter by programming language
  • tags - Filter by tags (comma-separated)
Example Response
{
  "snippets": [
    {
      "id": "snippet_123",
      "title": "Quick Sort Implementation",
      "code": "function quickSort(arr) { ... }",
      "language": "javascript",
      "tags": ["algorithm", "sorting"],
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1,
    "total_pages": 1
  }
}
POST/v2/snippets

Create a new code snippet.

Request Body
{
  "title": "Quick Sort Implementation",
  "code": "function quickSort(arr) { ... }",
  "language": "javascript",
  "description": "Efficient sorting algorithm",
  "tags": ["algorithm", "sorting"],
  "collection_id": "collection_456" // optional
}
Rate Limiting

API requests are rate limited to ensure fair usage across all users.

1,000

Requests per hour

100

Requests per minute

10

Requests per second

SDKs and Libraries

JavaScript

npm install Snippet Manager

Python

pip install Snippet Manager

Go

go get Snippet Manager

PHP

composer install