Space Frontiers Raw document downloads API

Authenticated, feature-gated streaming of PDF, EPUB, and DJVU library originals.

Operations 2

GET /v2/downloads/{filename} Original document by ID #
GET /v2/downloads/by-uri/{uri} Original document by URI #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/machinelibrary-ai:machinelibrary-ai-raw-document-downloads-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

machinelibrary-ai-raw-document-downloads-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Machine Library Raw document downloads API
  description: 'Search, retrieve, and synthesize scholarly and public-interest documents through Machine Library, the search and AI product by Space Frontiers Company. Document recognition endpoints (`/v1/recognitions`: PDF, EPUB, and DJVU to structured Markdown) share this host and are described at `/v1/recognitions/docs/openapi.json`; the site reference at https://machinelibrary.ai/docs/api/reference presents both specs merged.'
  license:
    name: MIT
    identifier: MIT
  version: 0.1.0
servers:
- url: https://api.machinelibrary.ai
  description: Machine Library
- url: https://api.spacefrontiers.org
  description: Space Frontiers (compatible endpoint)
tags:
- name: Raw document downloads
  description: Authenticated, feature-gated streaming of PDF, EPUB, and DJVU library originals.
paths:
  /v2/downloads/{filename}:
    get:
      tags:
      - Raw document downloads
      summary: Original document by ID
      description: Requires the durable raw-document-downloads feature and streams directly from object storage. See current pricing and access terms.
      operationId: downloadOriginaldocumentbyID
      security:
      - api_key: []
      - bearer_auth: []
      parameters:
      - name: filename
        in: path
        required: true
        description: Canonical document ID plus `.pdf`, `.epub`, or `.djvu`, for example `31tlqhmn2jmoh3gzlea74trb3.pdf`.
        schema:
          type: string
      - name: Range
        in: header
        required: false
        description: One RFC 9110 byte range, for example `bytes=0-1048575`. Multipart ranges are not supported.
        schema:
          type: string
      responses:
        '200':
          description: Complete original document.
          headers:
            Accept-Ranges:
              schema:
                type: string
                example: bytes
            Content-Disposition:
              schema:
                type: string
            Content-Length:
              schema:
                type: integer
                format: int64
            ETag:
              schema:
                type: string
            X-Spent-Budget:
              description: Amount charged in USD for this request. See [current pricing](https://machinelibrary.ai/pricing).
              schema:
                type: string
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            application/epub+zip:
              schema:
                type: string
                format: binary
            image/vnd.djvu:
              schema:
                type: string
                format: binary
        '206':
          description: Requested byte range.
          headers:
            Accept-Ranges:
              schema:
                type: string
                example: bytes
            Content-Disposition:
              schema:
                type: string
            Content-Length:
              schema:
                type: integer
                format: int64
            ETag:
              schema:
                type: string
            X-Spent-Budget:
              description: Amount charged in USD for this request. See [current pricing](https://machinelibrary.ai/pricing).
              schema:
                type: string
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            application/epub+zip:
              schema:
                type: string
                format: binary
            image/vnd.djvu:
              schema:
                type: string
                format: binary
        '400':
          description: Invalid document ID, URI, or format.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '401':
          description: Missing or invalid API credential.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '402':
          description: Insufficient account balance.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '403':
          description: The raw-document-downloads feature is missing. See https://machinelibrary.ai/pricing for current access terms.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '404':
          description: No matching original document is available.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '416':
          description: Invalid, unsatisfiable, or multipart range.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '502':
          description: Document storage is unavailable.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
  /v2/downloads/by-uri/{uri}:
    get:
      tags:
      - Raw document downloads
      summary: Original document by URI
      description: Requires the durable raw-document-downloads feature and streams directly from object storage. See current pricing and access terms. The URI is resolved through the canonical document_uris index.
      operationId: downloadOriginaldocumentbyURI
      security:
      - api_key: []
      - bearer_auth: []
      parameters:
      - name: uri
        in: path
        required: true
        description: Percent-encoded canonical URI copied from a search result, for example `doi%3A%2F%2F10.1000%2Fexample`.
        schema:
          type: string
          maxLength: 8192
      - name: format
        in: query
        required: false
        description: Request PDF, EPUB, or DJVU. The default is PDF.
        schema:
          type: string
          enum:
          - pdf
          - epub
          - djvu
      - name: Range
        in: header
        required: false
        description: One RFC 9110 byte range, for example `bytes=0-1048575`. Multipart ranges are not supported.
        schema:
          type: string
      responses:
        '200':
          description: Complete original document.
          headers:
            Accept-Ranges:
              schema:
                type: string
                example: bytes
            Content-Disposition:
              schema:
                type: string
            Content-Length:
              schema:
                type: integer
                format: int64
            ETag:
              schema:
                type: string
            X-Spent-Budget:
              description: Amount charged in USD for this request. See [current pricing](https://machinelibrary.ai/pricing).
              schema:
                type: string
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            application/epub+zip:
              schema:
                type: string
                format: binary
            image/vnd.djvu:
              schema:
                type: string
                format: binary
        '206':
          description: Requested byte range.
          headers:
            Accept-Ranges:
              schema:
                type: string
                example: bytes
            Content-Disposition:
              schema:
                type: string
            Content-Length:
              schema:
                type: integer
                format: int64
            ETag:
              schema:
                type: string
            X-Spent-Budget:
              description: Amount charged in USD for this request. See [current pricing](https://machinelibrary.ai/pricing).
              schema:
                type: string
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            application/epub+zip:
              schema:
                type: string
                format: binary
            image/vnd.djvu:
              schema:
                type: string
                format: binary
        '400':
          description: Invalid document ID, URI, or format.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '401':
          description: Missing or invalid API credential.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '402':
          description: Insufficient account balance.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '403':
          description: The raw-document-downloads feature is missing. See https://machinelibrary.ai/pricing for current access terms.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '404':
          description: No matching original document is available.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '416':
          description: Invalid, unsatisfiable, or multipart range.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
        '502':
          description: Document storage is unavailable.
          content:
            application/json:
              schema:
                type: object
                required:
                - detail
                - status
                properties:
                  detail: {}
                  status:
                    type: string
                    example: error
components:
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Machine Library API key from https://machinelibrary.ai/keys.
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: API key or OAuth 2.0 access token
      description: Send the same API key, or an OAuth 2.0 access token, as a Bearer token.
x-service-info:
  categories:
  - data
  - search
  docs:
    apiReference: https://machinelibrary.ai/docs/api/reference
    homepage: https://machinelibrary.ai
    llms: https://machinelibrary.ai/llms.txt