CLI
Install the HuntAPI CLI SDK and make your first API call.
The official HuntAPI command-line interface, with one command per endpoint.
Requirements
- Node.js 20+
Install
npm install --global @huntapi/cli
huntapi --helpnpx @huntapi/cli --helpGet your API key
Copy your API key from the HuntAPI dashboard and set it in the HUNTAPI_API_KEY environment variable, which the SDK reads by default. Keep it out of source control.
export HUNTAPI_API_KEY="YOUR_API_KEY"$env:HUNTAPI_API_KEY = "YOUR_API_KEY"Usage
huntapi media-metadata --query 'https://www.youtube.com/watch?v=Z5YP8kznWZs'huntapi media-metadata --help # parameters of one command
huntapi endpoints # every command and its HTTP path
huntapi endpoints search # filter the listecho '{"query": "https://www.youtube.com/watch?v=Z5YP8kznWZs"}' | huntapi media-metadata --params -
huntapi media-metadata --params params.json --compacthuntapi request get /v1/usage
huntapi request post /v1/some/new/endpoint --params body.jsonhuntapi media-metadata --query 'https://www.youtube.com/watch?v=Z5YP8kznWZs' | jq .Exit codes
0: success1: API or network failure2: invalid usage, such as an unknown command, a missing API key or a missing parameter
Links
- Package:
@huntapi/cli - Source code: github.com/huntapi/huntapi-cli
- API reference