Skip to main content
POST
/
api
/
crates
/
packages
/
search
/crates/packages/search
curl --request POST \
  --url https://api.anysite.io/api/crates/packages/search \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "count": 2,
  "timeout": 300,
  "query": "http client",
  "sort": "relevance",
  "category": "web-programming",
  "keyword": "http",
  "all_keywords": "http async",
  "user_id": 123,
  "team_id": 123,
  "letter": "<string>"
}
'
[
  {
    "name": "<string>",
    "@type": "CratesCrate",
    "description": "<string>",
    "homepage_url": "<string>",
    "documentation_url": "<string>",
    "repository_url": "<string>",
    "download_count": 0,
    "recent_download_count": 0,
    "version_count": 0,
    "default_version": "<string>",
    "newest_version": "<string>",
    "max_version": "<string>",
    "max_stable_version": "<string>",
    "is_yanked": false,
    "exact_match": true,
    "keywords": [],
    "categories": [],
    "created_at": "",
    "updated_at": "",
    "web_url": ""
  }
]

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
count
integer
required

Number of crates to return

Required range: x >= 1
timeout
integer
default:300

Max scrapping execution timeout (in seconds)

Required range: 20 <= x <= 1500
query
string | null

Search query matched against crate name and description

Example:

"http client"

sort
enum<string>
default:relevance

Result ordering

Available options:
relevance,
downloads,
recent-downloads,
recent-updates,
new,
alpha
category
string | null

Filter by category slug

Example:

"web-programming"

keyword
string | null

Filter by a single keyword

Example:

"http"

all_keywords
string | null

Filter by multiple space-separated keywords (all must match)

Example:

"http async"

user_id
integer | null

Filter to crates owned by this user id

team_id
integer | null

Filter to crates owned by this team id

letter
string | null

Filter to crates starting with this letter

Required string length: 1

Response

Successful Response

name
string
required
@type
string
default:CratesCrate
description
string | null
homepage_url
string | null
documentation_url
string | null
repository_url
string | null
download_count
integer
default:0
recent_download_count
integer
default:0
version_count
integer
default:0
default_version
string | null
newest_version
string | null
max_version
string | null
max_stable_version
string | null
is_yanked
boolean
default:false
exact_match
boolean | null
keywords
string[]
categories
string[]
created_at
string
default:""
updated_at
string
default:""
web_url
string
default:""