Skip to main content

CodeAnswr REST API v1

Integrate CodeAnswr's rich developer knowledge base directly into your applications.

Base URL

https://api.codeanswr.com/api/v1

Rate Limiting

The public API is currently unauthenticated and limited to 100 requests per hour per IP address. Rate limit status is returned in the X-RateLimit-Limit and X-RateLimit-Remaining response headers.

Endpoints

GET /api/v1/questions

List recently asked public questions.

Query Parameters

Parameter Type Default Description
page number 1 Page number
limit number 20 Results per page (max 50)

Example Response

{
  "data": [
    {
      "id": 1,
      "title": "How to center a div?",
      "excerpt": "I've tried margin: 0 auto...",
      "tags": ["css", "html"],
      "views": 42,
      "votes": 5,
      "is_answered": true,
      "author": "johndoe",
      "created_at": "2026-01-01T12:00:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 20 }
}
GET /api/v1/questions/:id

Get detailed information about a specific question, including its answers.

Example Response

{
  "data": {
    "id": 1,
    "title": "How to center a div?",
    "content": "Full markdown content...",
    "code": ".center { /* ??? */ }",
    "language": "css",
    "tags": ["css", "html"],
    "views": 43,
    "votes": 5,
    "is_answered": true,
    "author": "johndoe",
    "answers": [
      {
        "id": 101,
        "content": "Use flexbox: display: flex; justify-content: center; align-items: center;",
        "votes": 10,
        "is_accepted": true,
        "author": "janedoe",
        "created_at": "2026-01-01T12:05:00Z"
      }
    ]
  }
}
GET /api/v1/users

List top users by reputation.

Query Parameters

Parameter Type Default Description
page number 1 Page number
limit number 20 Results per page (max 50)

Example Response

{
  "data": [
    {
      "id": 1,
      "username": "janedoe",
      "reputation": 15420,
      "avatar_url": "https://...",
      "created_at": "2025-01-01T00:00:00Z"
    }
  ],
  "meta": { "page": 1, "limit": 20 }
}