{
 "openapi": "3.1.0",
 "info": {
  "title": "ECHO Web API",
  "version": "1.0.0",
  "description": "Static, read-only files describing and serving ECHO's datasets. No authentication. v1 is additive-only.",
  "contact": {
   "email": "echo@data.syr.edu"
  },
  "license": {
   "name": "CC0-1.0 (metadata)",
   "identifier": "CC0-1.0"
  }
 },
 "servers": [
  {
   "url": "https://echo.directory"
  }
 ],
 "paths": {
  "/api/v1/index.json": {
   "get": {
    "summary": "Index of all endpoints",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/api/v1/datasets.json": {
   "get": {
    "summary": "The catalogue",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "https://echo.directory/api/v1/schemas/catalog.json"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/api/v1/catalog.parquet": {
   "get": {
    "summary": "The catalogue as one Parquet table",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/vnd.apache.parquet": {}
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/api/v1/catalog.sqlite": {
   "get": {
    "summary": "The catalogue as an SQLite database",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/vnd.sqlite3": {}
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/api/v1/catalog.csv.gz": {
   "get": {
    "summary": "The catalogue as gzipped CSV",
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/gzip": {}
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/api/v1/dataset/{slug}.json": {
   "get": {
    "summary": "One dataset",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "https://echo.directory/api/v1/schemas/dataset.json"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/api/v1/dataset/{slug}/versions.json": {
   "get": {
    "summary": "Published package versions",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "https://echo.directory/api/v1/schemas/versions.json"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/api/v1/dataset/{slug}/{version}/files.json": {
   "get": {
    "summary": "Every file of a version",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "https://echo.directory/api/v1/schemas/files.json"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/api/v1/dataset/{slug}/{version}/schema.json": {
   "get": {
    "summary": "Tables and columns of a version",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "https://echo.directory/api/v1/schemas/schema.json"
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/cite/{slug}.json": {
   "get": {
    "summary": "How to cite (ECHO first, then the dataset)",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {}
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/cite/{slug}.bib": {
   "get": {
    "summary": "BibTeX",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/x-bibtex": {}
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  },
  "/download/{slug}/v{version}/{path}": {
   "get": {
    "summary": "A package file (supports HTTP Range)",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "path",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/octet-stream": {}
      }
     },
     "404": {
      "description": "Not found"
     },
     "429": {
      "description": "Download limit reached"
     }
    }
   }
  }
 }
}