The Programmatic API

This section covers the programmatic API that Alexandrie exposes.
Some of these endpoints are used by cargo itself when running commands like cargo search, cargo publish and some others.

URL format

Before anything, here is a description of the syntax used throughout these pages for writing URLs:

  • <name>: is either:
    • a placeholder for any path segment (when in within the pathname, eg. /crates/<name>)
    • a querystring variable (when in querystring position, eg. /search?<q>)
  • [...]: means that the the pattern inside these brackets is optional:
    • mostly used for optional querystring variables (eg. /search?<q>[&<page>])

Public Endpoints

Public endpoints are accessible without needing to authenticate.

Crates section:

Categories section:

Account management section:

  • Login: POST /api/v1/account/login
  • Register: POST /api/v1/account/register

Authenticated Endpoints

The following endpoints require a valid token to be specified in the Authorization request header.
Refer to the Authentication docs to learn how to get one and how to use it.

Crates section:

Account management section: