{
  "openapi": "3.1.0",
  "info": {
    "title": "CCCURJ public API",
    "version": "1.0.0",
    "description": "Read-only access to CCCURJ (California Community College Undergraduate Research Journal) metadata: OAI-PMH for repository harvesters, journal statistics, the contributor leaderboard and RSS feeds. No authentication. Content is licensed CC BY 4.0.",
    "contact": {
      "email": "hello@cccurj.org",
      "url": "https://cccurj.org/help/api"
    },
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "externalDocs": {
    "url": "https://cccurj.org/help/api"
  },
  "servers": [
    {
      "url": "https://cccurj.org"
    }
  ],
  "paths": {
    "/account/oai": {
      "get": {
        "summary": "OAI-PMH 2.0 endpoint (oai_dc metadata)",
        "operationId": "oaiPmh",
        "externalDocs": {
          "url": "https://www.openarchives.org/OAI/openarchivesprotocol.html"
        },
        "parameters": [
          {
            "name": "verb",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "Identify",
                "ListMetadataFormats",
                "ListSets",
                "ListIdentifiers",
                "ListRecords",
                "GetRecord"
              ]
            }
          },
          {
            "name": "metadataPrefix",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "oai_dc"
              ]
            }
          },
          {
            "name": "identifier",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "oai:cccurj.org:2610.00003"
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OAI-PMH XML response (errors are reported inside the XML)",
            "content": {
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/account/stats.json": {
      "get": {
        "summary": "CCCURJ Flagship review statistics",
        "operationId": "journalStats",
        "responses": {
          "200": {
            "description": "Counts and medians; sample papers excluded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "applications": {
                      "type": "integer"
                    },
                    "decided": {
                      "type": "integer"
                    },
                    "accepted": {
                      "type": "integer"
                    },
                    "declined": {
                      "type": "integer"
                    },
                    "acceptance_rate": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "days_to_first_decision": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "days_to_acceptance": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "reports_per_article": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "reviewer_agreement": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "review_rounds_compared": {
                      "type": "integer"
                    },
                    "preprints_checked": {
                      "type": "integer"
                    },
                    "preprints_announced": {
                      "type": "integer"
                    },
                    "days_to_announce": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "min_sample": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account/leaderboard.json": {
      "get": {
        "summary": "Leaderboard of editors and reviewers",
        "operationId": "leaderboard",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Time period; defaults to the current one"
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked contributors per role",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/account/health": {
      "get": {
        "summary": "Health check",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "Service is up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Database unavailable"
          }
        }
      }
    },
    "/rss/{code}": {
      "get": {
        "summary": "RSS 2.0 feed of the latest announcement for an archive or category",
        "operationId": "rss",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "cs.LG",
            "description": "Archive or category code, or flagship for journal articles"
          }
        ],
        "responses": {
          "200": {
            "description": "RSS feed",
            "content": {
              "application/rss+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
