crates.io Versions API

Yank and unyank crate versions

Operations 4

GET /api/v1/crates/{crate}/{version} Get Crate Version #
GET /api/v1/crates/{crate}/{version}/download Download Crate Tarball #
DELETE /api/v1/crates/{crate}/{version}/yank Yank A Crate Version #
PUT /api/v1/crates/{crate}/{version}/unyank Unyank A Crate Version #

Documentation

Specifications

Schemas & Data

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/crates-io-versions-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

crates-io-versions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: crates.io Web Versions API
  description: 'The crates.io Registry Web API exposes endpoints used by Cargo and the crates.io website for searching, publishing, yanking, and managing crate ownership. The API is hosted at https://crates.io under the /api/v1 prefix and is the canonical implementation of the Cargo Registry Web API specification.

    '
  version: v1
  contact:
    name: crates.io Team
    email: help@crates.io
    url: https://crates.io
  license:
    name: Cargo Documentation (MIT/Apache-2.0)
    url: https://doc.rust-lang.org/cargo/reference/registry-web-api.html
servers:
- url: https://crates.io
  description: crates.io Production
security:
- ApiTokenAuth: []
tags:
- name: Versions
  description: Yank and unyank crate versions
paths:
  /api/v1/crates/{crate}/{version}:
    get:
      summary: Get Crate Version
      description: Retrieve metadata for a specific version of a crate.
      operationId: getCrateVersion
      tags:
      - Versions
      security: []
      parameters:
      - $ref: '#/components/parameters/CrateName'
      - $ref: '#/components/parameters/Version'
      responses:
        '200':
          description: Version metadata document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VersionDetailResponse'
        '404':
          $ref: '#/components/responses/Error'
  /api/v1/crates/{crate}/{version}/download:
    get:
      summary: Download Crate Tarball
      description: 'Returns a redirect to the .crate tarball stored in the crates.io S3 bucket. This is the canonical download URL used by Cargo.

        '
      operationId: downloadCrate
      tags:
      - Versions
      security: []
      parameters:
      - $ref: '#/components/parameters/CrateName'
      - $ref: '#/components/parameters/Version'
      responses:
        '302':
          description: Redirect to the gzipped tar archive of the crate version.
          headers:
            Location:
              schema:
                type: string
                format: uri
        '404':
          $ref: '#/components/responses/Error'
  /api/v1/crates/{crate}/{version}/yank:
    delete:
      summary: Yank A Crate Version
      description: 'Mark a specific crate version as yanked so that it is no longer selected as a fresh dependency. Existing Cargo.lock files continue to resolve against yanked versions.

        '
      operationId: yankVersion
      tags:
      - Versions
      parameters:
      - $ref: '#/components/parameters/CrateName'
      - $ref: '#/components/parameters/Version'
      responses:
        '200':
          description: Yank successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkResponse'
        '403':
          $ref: '#/components/responses/Error'
  /api/v1/crates/{crate}/{version}/unyank:
    put:
      summary: Unyank A Crate Version
      description: Restore a previously yanked version of a crate.
      operationId: unyankVersion
      tags:
      - Versions
      parameters:
      - $ref: '#/components/parameters/CrateName'
      - $ref: '#/components/parameters/Version'
      responses:
        '200':
          description: Unyank successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkResponse'
        '403':
          $ref: '#/components/responses/Error'
components:
  schemas:
    ErrorResponse:
      type: object
      required:
      - errors
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
    VersionDetailResponse:
      type: object
      required:
      - version
      properties:
        version:
          $ref: '#/components/schemas/Version'
    OkResponse:
      type: object
      required:
      - ok
      properties:
        ok:
          type: boolean
    Version:
      type: object
      required:
      - num
      - crate
      properties:
        id:
          type: integer
        crate:
          type: string
        num:
          type: string
        dl_path:
          type: string
        readme_path:
          type: string
        updated_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        downloads:
          type: integer
        features:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        yanked:
          type: boolean
        license:
          type: string
        rust_version:
          type: string
          nullable: true
        crate_size:
          type: integer
          nullable: true
  parameters:
    CrateName:
      name: crate
      in: path
      required: true
      description: The crate name (e.g. serde, tokio, rand).
      schema:
        type: string
    Version:
      name: version
      in: path
      required: true
      description: The semver version of the crate (e.g. 1.0.0).
      schema:
        type: string
  responses:
    Error:
      description: Error envelope returned by the crates.io API.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'A crates.io API token created at https://crates.io/settings/tokens. The raw token is sent in the Authorization header without a Bearer prefix.

        '