{
  "openapi": "3.1.0",
  "info": {
    "title": "Infinite Researchers API",
    "description": "AI-powered scientific research tools API. Search preprints, find open access papers, check FAIR compliance, and discover collaborative research.",
    "version": "1.0.0",
    "contact": {
      "name": "Infinite Researchers API Support",
      "email": "api@infiniteresearchers.com",
      "url": "https://infiniteresearchers.com"
    },
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "servers": [
    {
      "url": "https://api.infiniteresearchers.com/v1",
      "description": "Production API"
    }
  ],
  "paths": {
    "/preprints/search": {
      "get": {
        "operationId": "searchPreprints",
        "summary": "Search for preprints",
        "description": "Search across 50+ preprint servers including arXiv, bioRxiv, medRxiv for scientific papers",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search query",
            "schema": {"type": "string"}
          },
          {
            "name": "source",
            "in": "query",
            "description": "Filter by preprint server (arxiv, biorxiv, medrxiv, etc)",
            "schema": {"type": "string"}
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of results (default 10, max 100)",
            "schema": {"type": "integer", "default": 10}
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {"type": "string"},
                          "authors": {"type": "array", "items": {"type": "string"}},
                          "abstract": {"type": "string"},
                          "url": {"type": "string"},
                          "source": {"type": "string"},
                          "date": {"type": "string"}
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/openaccess/find": {
      "get": {
        "operationId": "findOpenAccess",
        "summary": "Find open access version of a paper",
        "description": "Given a DOI or title, find freely accessible versions of the paper",
        "parameters": [
          {
            "name": "doi",
            "in": "query",
            "description": "Paper DOI",
            "schema": {"type": "string"}
          },
          {
            "name": "title",
            "in": "query",
            "description": "Paper title (if DOI not available)",
            "schema": {"type": "string"}
          }
        ],
        "responses": {
          "200": {
            "description": "Open access locations found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "is_oa": {"type": "boolean"},
                    "oa_locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {"type": "string"},
                          "version": {"type": "string"},
                          "license": {"type": "string"}
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/fair/check": {
      "post": {
        "operationId": "checkFAIRCompliance",
        "summary": "Check FAIR compliance of a dataset",
        "description": "Assess how well a dataset follows FAIR (Findable, Accessible, Interoperable, Reusable) principles",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {"type": "string", "description": "Dataset URL or DOI"},
                  "metadata": {"type": "object", "description": "Optional metadata to check"}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "FAIR assessment results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "score": {"type": "number"},
                    "findable": {"type": "number"},
                    "accessible": {"type": "number"},
                    "interoperable": {"type": "number"},
                    "reusable": {"type": "number"},
                    "recommendations": {"type": "array", "items": {"type": "string"}}
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
