{
  "openapi": "3.0.3",
  "info": {
    "title": "FindAPI Directory",
    "description": "Public REST API for searching and browsing the FindAPI developer API directory.",
    "version": "1.0.0",
    "contact": {
      "name": "FindAPI",
      "url": "https://www.findapi.dev"
    }
  },
  "servers": [
    {
      "url": "https://www.findapi.dev",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/apis": {
      "get": {
        "summary": "Search and list APIs",
        "operationId": "listApis",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Free text search across name, description, provider"
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by category name"
          },
          {
            "name": "tags",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated tag slugs"
          },
          {
            "name": "pricing",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "free",
                "freemium",
                "paid"
              ]
            },
            "description": "Filter by pricing tier"
          },
          {
            "name": "auth",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "api-key",
                "oauth",
                "none"
              ]
            },
            "description": "Filter by auth type"
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "recent",
                "popular",
                "name"
              ],
              "default": "recent"
            },
            "description": "Sort order"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100
            },
            "description": "Max results per page"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "Number of results to skip"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of APIs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiItem"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/apis/{slug}": {
      "get": {
        "summary": "Get a single API by slug",
        "operationId": "getApi",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "API slug identifier"
          }
        ],
        "responses": {
          "200": {
            "description": "API details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiItem"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "API not found"
          }
        }
      }
    },
    "/api/v1/categories": {
      "get": {
        "summary": "List all categories",
        "operationId": "listCategories",
        "responses": {
          "200": {
            "description": "List of categories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TaxonomyItem"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tags": {
      "get": {
        "summary": "List all tags",
        "operationId": "listTags",
        "responses": {
          "200": {
            "description": "List of tags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TaxonomyItem"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pricing": {
            "type": "string",
            "enum": [
              "Free",
              "Free + Paid",
              "Paid only"
            ]
          },
          "auth": {
            "type": "string",
            "enum": [
              "API Key",
              "OAuth",
              "None"
            ]
          },
          "cors": {
            "type": "string",
            "enum": [
              "Yes",
              "No",
              "Unknown"
            ]
          },
          "status": {
            "type": "string"
          },
          "startingPrice": {
            "type": "string"
          },
          "freeNote": {
            "type": "string",
            "nullable": true
          },
          "websiteUrl": {
            "type": "string",
            "format": "uri"
          },
          "icon": {
            "type": "string"
          },
          "logoUrl": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "popularity": {
            "type": "integer"
          }
        }
      },
      "TaxonomyItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "Links": {
        "type": "object",
        "properties": {
          "self": {
            "type": "string"
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        }
      }
    }
  }
}