{
  "openapi": "3.1.0",
  "info": {
    "title": "Coinlib Content API",
    "version": "1.0.0",
    "summary": "Free, key-less access to Coinlib's own editorial crypto content.",
    "description": "Read-only JSON API for the editorial content Coinlib writes in-house: coin analysis articles, guides and newsroom posts, and per-coin FAQs. No API key, no signup — every endpoint is an anonymous HTTP GET served from a CDN edge cache.\n\nAgents are explicitly welcome. See https://coinlib.io/for-agents for the usage terms and https://coinlib.io/llms.txt for a plain-text site map.\n\n**MCP server.** The same content is available over Model Context Protocol at https://mcp.coinlib.io (Streamable HTTP, no auth) — add it to Claude or any MCP client. See https://coinlib.io/for-agents.\n\n**Market data is not available through this API.** Prices, market caps, volumes, rankings, exchange data and conversion rates shown on coinlib.io are licensed from CoinMarketCap and CoinGecko under terms that let us use them in our own product but not redistribute them through an API of our own. For those figures, read the HTML pages on coinlib.io (see /llms.txt for URL patterns) or go to CoinMarketCap directly.\n\n**Not financial advice.** Coinlib is an information source only. See https://coinlib.io/disclaimer.",
    "contact": {
      "name": "Coinlib",
      "url": "https://coinlib.io/for-agents"
    },
    "termsOfService": "https://coinlib.io/for-agents"
  },
  "servers": [
    {
      "url": "https://coinlib.io",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Agent usage guide and terms",
    "url": "https://coinlib.io/for-agents"
  },
  "tags": [
    {
      "name": "Content",
      "description": "Analysis articles, guides, and newsroom posts written by the Coinlib team"
    },
    {
      "name": "Coins",
      "description": "Per-coin editorial content: FAQs and analysis"
    }
  ],
  "paths": {
    "/api/v1/coins/{slug}/faqs": {
      "get": {
        "tags": [
          "Coins"
        ],
        "operationId": "getCoinFaqs",
        "summary": "Get editorial Q&A for one coin",
        "description": "Short, citable answers to common questions about the coin — useful as grounded context for a natural-language answer.",
        "parameters": [
          {
            "$ref": "#/components/parameters/CoinSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "FAQ entries.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "question": {
                                "type": "string"
                              },
                              "answer": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/NotModified"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/coins/{slug}/analysis": {
      "get": {
        "tags": [
          "Coins"
        ],
        "operationId": "getCoinAnalysis",
        "summary": "List published analysis articles for one coin",
        "parameters": [
          {
            "$ref": "#/components/parameters/CoinSlug"
          }
        ],
        "responses": {
          "200": {
            "description": "Analysis articles, newest first.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AnalysisPost"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/NotModified"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analysis": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "listAnalysis",
        "summary": "List published analysis articles across all coins",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Values above 100 are clamped to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analysis articles, newest first. Includes full `body`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AnalysisPost"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/analysis/{idOrSlug}": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "getAnalysis",
        "summary": "Get one analysis article",
        "parameters": [
          {
            "name": "idOrSlug",
            "in": "path",
            "required": true,
            "description": "Article slug, or its numeric id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The article, including full `body`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/AnalysisPost"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/newsroom/{category}/{slug}": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "getNewsroomPost",
        "summary": "Get one newsroom post (guide or article)",
        "parameters": [
          {
            "name": "category",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "guides",
                "technology",
                "trading-software"
              ]
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The post, including full `body`.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/NewsroomPost"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "CoinSlug": {
        "name": "slug",
        "in": "path",
        "required": true,
        "description": "Lowercase coin slug, e.g. `bitcoin`, `ethereum`, `shiba-inu` — the coin name lowercased with spaces replaced by hyphens. The same slug appears in the coin page URL at /coin/{SYMBOL}/{Name-Slug}.",
        "schema": {
          "type": "string"
        },
        "example": "bitcoin"
      }
    },
    "headers": {
      "ETag": {
        "description": "Content hash. Send it back as `If-None-Match` to get a `304` when nothing changed.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "NotModified": {
        "description": "Content unchanged since the `ETag` you sent. Empty body — reuse your cached copy."
      },
      "NotFound": {
        "description": "No such resource. `data` is null and `error` describes the miss.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Error": {
        "description": "Upstream or internal failure. `data` is null and `error` carries the message.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      }
    },
    "schemas": {
      "Envelope": {
        "type": "object",
        "description": "Every endpoint returns this wrapper. Check `error` before reading `data`.",
        "required": [
          "data",
          "error"
        ],
        "properties": {
          "data": {
            "description": "Payload, or null when `error` is set."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null on success."
          },
          "meta": {
            "type": "object",
            "properties": {
              "cached": {
                "type": "boolean"
              },
              "timestamp": {
                "type": "integer",
                "description": "Unix milliseconds."
              },
              "total": {
                "type": "integer",
                "description": "Total rows available, on paginated endpoints."
              }
            }
          }
        }
      },
      "AnalysisPost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "excerpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "HTML."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "published_at": {
            "type": "string",
            "format": "date-time"
          },
          "author_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "coin_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Associated coin. Present on /api/v1/analysis endpoints; omitted from /api/v1/coins/{slug}/analysis, where the coin is already known."
          },
          "coin_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "coin_symbol": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "NewsroomPost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "category": {
            "type": "string",
            "enum": [
              "guides",
              "technology",
              "trading-software"
            ]
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "excerpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "HTML."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "published_at": {
            "type": "string",
            "format": "date-time"
          },
          "author_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "seo_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "seo_description": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}
