{
  "openapi": "3.0.0",
  "info": {
    "title": "Tindposting API",
    "description": "API for fetching latest news and articles from Tindposting. Designed for AI crawlers and bots.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://tindposting.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/api/posts": {
      "get": {
        "summary": "Get latest posts",
        "description": "Retrieve a list of posts with filtering and search capabilities.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number for pagination",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search keyword for full-text search",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from_date",
            "in": "query",
            "description": "Start date filter (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to_date",
            "in": "query",
            "description": "End date filter (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of posts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Post"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Post": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "published_at": {
            "type": "string",
            "format": "date-time"
          },
          "slug": {
            "type": "string"
          },
          "thumbnail_url": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "nullable": true
          },
          "source_domain": {
            "type": "string",
            "nullable": true
          }
        }
      }
    }
  }
}
