{
  "components": {
    "schemas": {
      "PaperList": {
        "properties": {
          "next": {
            "type": [
              "string",
              "null"
            ]
          },
          "page": {
            "type": "integer"
          },
          "per_page": {
            "type": "integer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/PaperRow"
            },
            "type": "array"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PaperRow": {
        "properties": {
          "author_count": {
            "type": "integer"
          },
          "authors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cited_by": {
            "type": "integer"
          },
          "doi": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_full_text": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "licence": {
            "description": "SPDX-like identifier (CC-BY-4.0, CC0-1.0, LicenseRef-…, unknown)",
            "type": "string"
          },
          "published": {
            "format": "date",
            "type": "string"
          },
          "sources": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "subjects": {
            "items": {
              "properties": {
                "field": {
                  "type": "string"
                },
                "subfield": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "title": {
            "description": "May contain inline TeX between $…$",
            "type": "string"
          },
          "title_text": {
            "type": "string"
          },
          "type": {
            "enum": [
              "preprint",
              "peer-reviewed"
            ],
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "venue": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      }
    }
  },
  "info": {
    "contact": {
      "email": "support@draconitic.com"
    },
    "description": "Open-access studies by field and subfield, from preprint servers, literature indexes, publishers and journal feeds. Abstracts are included only when the work or its metadata is under CC0, a Creative Commons licence or public domain.",
    "title": "Draconitic Research API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/fields": {
      "get": {
        "operationId": "listFields",
        "responses": {
          "200": {
            "description": "Taxonomy with counts"
          }
        },
        "summary": "Fields and subfields with counts"
      }
    },
    "/api/v1/fields/{field}": {
      "get": {
        "operationId": "getField",
        "parameters": [
          {
            "in": "path",
            "name": "field",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Field with subfields"
          },
          "404": {
            "description": "Unknown field"
          }
        },
        "summary": "One field"
      }
    },
    "/api/v1/lookup": {
      "get": {
        "operationId": "lookupPaper",
        "parameters": [
          {
            "in": "query",
            "name": "doi",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "arxiv",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pmid",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "pmcid",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The paper"
          },
          "404": {
            "description": "Not in the collection"
          }
        },
        "summary": "Find a paper by identifier"
      }
    },
    "/api/v1/papers": {
      "get": {
        "operationId": "listPapers",
        "parameters": [
          {
            "in": "query",
            "name": "field",
            "schema": {
              "enum": [
                "mathematics",
                "physics",
                "astronomy",
                "earth",
                "chemistry",
                "biochemistry",
                "biology",
                "medicine"
              ],
              "type": "string"
            }
          },
          {
            "description": "Subfield slug within the field (see /api/v1/fields)",
            "in": "query",
            "name": "subfield",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "schema": {
              "enum": [
                "arxiv",
                "biorxiv",
                "medrxiv",
                "chemrxiv",
                "osf",
                "eartharxiv",
                "ecoevorxiv",
                "egusphere",
                "europepmc",
                "pmc",
                "doaj",
                "openalex",
                "crossref",
                "plos",
                "elife",
                "zenodo",
                "hal",
                "scielo",
                "jstage",
                "feed-nature",
                "feed-science",
                "feed-aps",
                "feed-iop",
                "feed-oup",
                "feed-frontiers",
                "feed-copernicus",
                "feed-springer",
                "feed-scipost",
                "feed-quantum",
                "feed-f1000",
                "feed-cell"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "enum": [
                "preprint",
                "journal"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "licence",
            "schema": {
              "enum": [
                "cc-by",
                "cc-by-sa",
                "cc-by-nc",
                "cc-by-nc-sa",
                "cc-by-nd",
                "cc-by-nc-nd",
                "cc0",
                "public-domain",
                "other",
                "unknown",
                "open"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "fulltext",
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "newest",
                "cited",
                "relevance"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "maximum": 400,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperList"
                }
              }
            },
            "description": "A page of papers"
          }
        },
        "summary": "Papers, newest first"
      }
    },
    "/api/v1/papers/{id}": {
      "get": {
        "operationId": "getPaper",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paper with authors, ORCIDs, affiliations, licence, links, subjects, sources and versions"
          },
          "404": {
            "description": "Unknown id"
          }
        },
        "summary": "One paper"
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "searchPapers",
        "parameters": [
          {
            "description": "Words, \"phrases\", prefix*, author:name, title:word",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "field",
            "schema": {
              "enum": [
                "mathematics",
                "physics",
                "astronomy",
                "earth",
                "chemistry",
                "biochemistry",
                "biology",
                "medicine"
              ],
              "type": "string"
            }
          },
          {
            "description": "Subfield slug within the field (see /api/v1/fields)",
            "in": "query",
            "name": "subfield",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "schema": {
              "enum": [
                "arxiv",
                "biorxiv",
                "medrxiv",
                "chemrxiv",
                "osf",
                "eartharxiv",
                "ecoevorxiv",
                "egusphere",
                "europepmc",
                "pmc",
                "doaj",
                "openalex",
                "crossref",
                "plos",
                "elife",
                "zenodo",
                "hal",
                "scielo",
                "jstage",
                "feed-nature",
                "feed-science",
                "feed-aps",
                "feed-iop",
                "feed-oup",
                "feed-frontiers",
                "feed-copernicus",
                "feed-springer",
                "feed-scipost",
                "feed-quantum",
                "feed-f1000",
                "feed-cell"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "enum": [
                "preprint",
                "journal"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "licence",
            "schema": {
              "enum": [
                "cc-by",
                "cc-by-sa",
                "cc-by-nc",
                "cc-by-nc-sa",
                "cc-by-nd",
                "cc-by-nc-nd",
                "cc0",
                "public-domain",
                "other",
                "unknown",
                "open"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "fulltext",
            "schema": {
              "enum": [
                "1"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "newest",
                "cited",
                "relevance"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "maximum": 400,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperList"
                }
              }
            },
            "description": "Matches with facets"
          }
        },
        "summary": "Full-text search over titles, abstracts and authors"
      }
    },
    "/api/v1/sources": {
      "get": {
        "operationId": "listSources",
        "responses": {
          "200": {
            "description": "Sources"
          }
        },
        "summary": "Sources with counts, status, cadence and terms"
      }
    }
  },
  "servers": [
    {
      "url": "https://research.draconitic.com"
    }
  ]
}