Skip to main content
API v1.0

API Documentation

Build powerful integrations with THE NODE API

RESTful Architecture
JSON Response Format
OAuth 2.0 Authentication
Rate Limited 1000 req/hour

Introduction

The NODE API allows you to programmatically access and interact with our platform.

Base URL https://the-node.fairewebhost.ca/api/v1

Key Features

  • RESTful Architecture: Standard HTTP methods (GET, POST, PUT, DELETE)
  • JSON Format: All responses are in JSON format
  • OAuth 2.0: Secure authentication with Bearer tokens
  • Rate Limited: Fair usage policy with rate limiting
  • Versioned: API versioning for backward compatibility

Quick Example

cURL
curl -X GET "https://the-node.fairewebhost.ca/api/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Authentication

THE NODE API uses Bearer token authentication. Include your API key in the Authorization header of every request.

Getting Your API Key

  1. Log in to your account
  2. Navigate to Settings → API
  3. Click "Generate New API Key"
  4. Copy and securely store your key
Security Warning

Never share your API key or commit it to version control. Treat it like a password.

Authentication Header

HTTP
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Example Request

cURL
JavaScript
PHP
Python
cURL
curl -X GET "https://the-node.fairewebhost.ca/api/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
JavaScript (Fetch)
const response = await fetch('https://the-node.fairewebhost.ca/api/v1/posts', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});
const data = await response.json();
console.log(data);
PHP
$ch = curl_init('https://the-node.fairewebhost.ca/api/v1/posts');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_KEY',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
Python (Requests)
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
}

response = requests.get('https://the-node.fairewebhost.ca/api/v1/posts', headers=headers)
data = response.json()
print(data)

Rate Limits

To ensure fair usage and system stability, API requests are rate limited.

Plan Requests/Hour Requests/Day
Free 100 1,000
Beta 1,000 10,000
Pro 5,000 50,000
Enterprise Custom Custom

Rate Limit Headers

Every API response includes rate limit information in the headers:

HTTP Headers
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1609459200

Exceeding Rate Limits

If you exceed your rate limit, you'll receive a 429 Too Many Requests response:

JSON
{
  "error": "rate_limit_exceeded",
  "message": "Rate limit exceeded. Please try again later.",
  "retry_after": 3600
}

Error Handling

THE NODE API uses standard HTTP response codes to indicate success or failure.

HTTP Status Codes

200 OK

Request successful

201 Created

Resource created successfully

400 Bad Request

Invalid request parameters

401 Unauthorized

Invalid or missing API key

403 Forbidden

Insufficient permissions

404 Not Found

Resource not found

429 Too Many Requests

Rate limit exceeded

500 Server Error

Internal server error

Error Response Format

JSON
{
  "error": "validation_error",
  "message": "The title field is required.",
  "details": {
    "field": "title",
    "code": "required"
  }
}

Posts

Manage posts through the API.

GET
/api/v1/posts

Retrieve a list of posts.

Query Parameters

Parameter Type Description
page integer Page number (default: 1)
limit integer Items per page (default: 20, max: 100)
category integer Filter by category ID
sort string Sort by: latest, popular, trending

Example Response

JSON
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Welcome to THE NODE",
      "slug": "welcome-to-the-node",
      "content": "This is a sample post...",
      "author": {
        "id": 1,
        "username": "admin",
        "display_name": "Administrator"
      },
      "category": {
        "id": 1,
        "name": "Announcements"
      },
      "views": 156,
      "likes": 23,
      "replies": 12,
      "created_at": "2026-02-01T10:30:00Z",
      "updated_at": "2026-02-07T15:45:00Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 5,
    "total_items": 95,
    "per_page": 20
  }
}
GET
/api/v1/posts/{id}

Retrieve a single post by ID.

Example Response

JSON
{
  "success": true,
  "data": {
    "id": 1,
    "title": "Welcome to THE NODE",
    "slug": "welcome-to-the-node",
    "content": "Full post content here...",
    "author": {
      "id": 1,
      "username": "admin",
      "display_name": "Administrator",
      "avatar": "https://..."
    },
    "category": {
      "id": 1,
      "name": "Announcements",
      "slug": "announcements"
    },
    "tags": ["welcome", "announcement"],
    "views": 156,
    "likes": 23,
    "replies": 12,
    "is_pinned": true,
    "is_locked": false,
    "created_at": "2026-02-01T10:30:00Z",
    "updated_at": "2026-02-07T15:45:00Z"
  }
}
POST
/api/v1/posts

Create a new post.

Request Body

JSON
{
  "title": "My New Post",
  "content": "Post content goes here...",
  "category_id": 1,
  "tags": ["tutorial", "guide"]
}
PUT
/api/v1/posts/{id}

Update an existing post.

DELETE
/api/v1/posts/{id}

Delete a post.

Users

Access user information and profiles.

GET
/api/v1/users/{id}

Retrieve user information by ID.

Example Response

JSON
{
  "success": true,
  "data": {
    "id": 1,
    "username": "johndoe",
    "display_name": "John Doe",
    "avatar": "https://...",
    "bio": "Web developer and tech enthusiast",
    "reputation": 1250,
    "badges": [
      {
        "id": 1,
        "name": "Beta Tester",
        "icon": "🏆"
      }
    ],
    "stats": {
      "posts": 45,
      "comments": 156,
      "likes_received": 234
    },
    "joined_at": "2025-12-01T08:00:00Z"
  }
}

Webhooks

Receive real-time notifications about events in your application.

Available Events

  • post.created - New post created
  • post.updated - Post updated
  • post.deleted - Post deleted
  • comment.created - New comment added
  • user.registered - New user registered

Webhook Payload

JSON
{
  "event": "post.created",
  "timestamp": "2026-02-07T12:30:00Z",
  "data": {
    "id": 123,
    "title": "New Post Title",
    "author_id": 1
  }
}

Changelog

Track API updates and changes.

v1.0.0 February 7, 2026

Initial Release

  • Posts API endpoints
  • Users API endpoints
  • Categories API endpoints
  • Comments API endpoints
  • OAuth 2.0 authentication
  • Rate limiting