# crates.io on Onekey > 15 endpoints for crates.io (15 stable, 0 beta), 1 to 5 credits each. Category: Developer platforms. One key, one JSON shape. Base URL: https://api.onekey.dev Auth: header `x-api-key: `. Call shape: `GET /v1/{platform}/{endpoint}?{params}`. Every response is `{success, data, metadata, error}`; check `success` first. Cost is in `metadata.credits_charged`. Free when served from cache (0.2 credit for a cached response over 100 KB). Failed and not-found calls are refunded. Status: stable = verified against the live source; beta = not yet verified, fields may be missing. Page: https://onekey.dev/platforms/crates Reference (Markdown): https://onekey.dev/docs/api/crates.md All docs: https://onekey.dev/llms.txt ## Canonical fields returned Unified-schema fields (same names on every platform), with how many of the 15 mapped crates.io endpoints return each: - `entity.name` (string): 10 - `entity.stats.downloads` (integer): 9 - `entity.createdAt` (ISO 8601 date): 8 - `package.version` (string): 8 - `entity.description` (string): 6 - `entity.updatedAt` (ISO 8601 date): 5 - `package.documentationUrl` (URL): 5 - `package.homepageUrl` (URL): 5 - `package.repositoryUrl` (URL): 5 - `author.username` (string): 3 - `author.avatarUrl` (URL): 2 - `author.displayName` (string): 2 - `author.id` (string): 2 - `author.url` (URL): 2 - `entity.id` (string): 2 - `package.license` (string): 2 - `package.yanked` (boolean): 2 - `author.createdAt` (ISO 8601 date): 1 - `content.createdAt` (ISO 8601 date): 1 - `content.id` (string): 1 - `engagement.views` (integer): 1 - `entity.tags` (list of strings): 1 - plus 11 platform-specific fields under `ext.` ## Endpoints ### crates.categories crates.io categories with crate counts. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/categories` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `entity.id`, `entity.name`, `entity.description`, `ext.crates` - Reference: https://onekey.dev/docs/api/crates/categories.md ### crates.crate Metadata and stats of a crate on crates.io. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/crates/crate?name=serde` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): crates.io crate name, e.g. serde - Fields returned: `entity.name`, `package.version`, `entity.description`, `package.homepageUrl`, `package.repositoryUrl`, `package.documentationUrl`, `entity.createdAt`, `entity.updatedAt`, `entity.stats.downloads`, `entity.tags`, `ext.recentDownloads`, `ext.versionCount`, `ext.entityCategories` - Reference: https://onekey.dev/docs/api/crates/crate.md ### crates.dependencies Dependencies of a crate version. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/dependencies?name=serde&version=1.0.200` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): crates.io crate name, e.g. serde - `version` (string, required): Exact crate version, e.g. 1.0.200 - Fields returned: `entity.name`, `ext.requirement`, `ext.kind`, `ext.optional`, `ext.defaultFeatures` - Reference: https://onekey.dev/docs/api/crates/dependencies.md ### crates.downloads Daily download counts of a crate (90 days). - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/downloads?name=serde` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): crates.io crate name, e.g. serde - Fields returned: `content.createdAt`, `engagement.views`, `content.id` - Reference: https://onekey.dev/docs/api/crates/downloads.md ### crates.just_updated Crates most recently updated. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/just_updated` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `entity.name`, `package.version`, `entity.description`, `package.homepageUrl`, `package.repositoryUrl`, `package.documentationUrl`, `entity.createdAt`, `entity.updatedAt`, `entity.stats.downloads`, `ext.recentDownloads`, `ext.versionCount` - Reference: https://onekey.dev/docs/api/crates/just_updated.md ### crates.keywords crates.io keywords with crate counts. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/keywords` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `entity.id`, `entity.name`, `ext.crates` - Reference: https://onekey.dev/docs/api/crates/keywords.md ### crates.most_downloaded Most downloaded crates of all time. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/most_downloaded` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `entity.name`, `package.version`, `entity.description`, `package.homepageUrl`, `package.repositoryUrl`, `package.documentationUrl`, `entity.createdAt`, `entity.updatedAt`, `entity.stats.downloads`, `ext.recentDownloads`, `ext.versionCount` - Reference: https://onekey.dev/docs/api/crates/most_downloaded.md ### crates.new_crates Newest crates on crates.io. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/new_crates` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `entity.name`, `package.version`, `entity.description`, `package.homepageUrl`, `package.repositoryUrl`, `package.documentationUrl`, `entity.createdAt`, `entity.updatedAt`, `entity.stats.downloads`, `ext.recentDownloads`, `ext.versionCount` - Reference: https://onekey.dev/docs/api/crates/new_crates.md ### crates.owners Owners of a crate. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/owners?name=serde` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): crates.io crate name, e.g. serde - Fields returned: `author.id`, `author.username`, `author.displayName`, `author.url`, `author.avatarUrl`, `ext.kind` - Reference: https://onekey.dev/docs/api/crates/owners.md ### crates.reverse_dependencies Crates that depend on a given crate. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/reverse_dependencies?name=serde` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): crates.io crate name, e.g. serde - Fields returned: `entity.name`, `package.version`, `entity.stats.downloads`, `entity.createdAt` - Reference: https://onekey.dev/docs/api/crates/reverse_dependencies.md ### crates.search Search crates.io. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/search?q=serde` with header `x-api-key: YOUR_API_KEY` - Parameters: - `q` (string, required): Search query - Fields returned: `entity.name`, `package.version`, `entity.description`, `package.homepageUrl`, `package.repositoryUrl`, `package.documentationUrl`, `entity.createdAt`, `entity.updatedAt`, `entity.stats.downloads`, `ext.recentDownloads`, `ext.versionCount` - Reference: https://onekey.dev/docs/api/crates/search.md ### crates.stats Global crates.io totals (crates and downloads). - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/crates/stats` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `entity.stats.downloads`, `ext.crates` - Reference: https://onekey.dev/docs/api/crates/stats.md ### crates.user Public profile of a crates.io user. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/crates/user?login=dtolnay` with header `x-api-key: YOUR_API_KEY` - Parameters: - `login` (string, required): crates.io login - Fields returned: `author.id`, `author.username`, `author.displayName`, `author.url`, `author.avatarUrl`, `author.createdAt` - Reference: https://onekey.dev/docs/api/crates/user.md ### crates.version Metadata of one specific crate version. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/crates/version?name=serde&version=1.0.200` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): crates.io crate name, e.g. serde - `version` (string, required): Exact crate version, e.g. 1.0.200 - Fields returned: `entity.name`, `package.version`, `entity.createdAt`, `entity.stats.downloads`, `package.license`, `package.yanked`, `author.username`, `ext.rustVersion`, `ext.edition` - Reference: https://onekey.dev/docs/api/crates/version.md ### crates.versions Most recent published versions of a crate. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/crates/versions?name=serde` with header `x-api-key: YOUR_API_KEY` - Parameters: - `name` (string, required): crates.io crate name, e.g. serde - Fields returned: `package.version`, `entity.createdAt`, `entity.stats.downloads`, `package.license`, `package.yanked`, `ext.rustVersion`, `ext.size` - Reference: https://onekey.dev/docs/api/crates/versions.md ## Sample request ```bash curl "https://api.onekey.dev/v1/crates/crate?name=serde" \ -H "x-api-key: YOUR_API_KEY" ```