HuntAPI

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 --help
npx @huntapi/cli --help

Get 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 list
echo '{"query": "https://www.youtube.com/watch?v=Z5YP8kznWZs"}' | huntapi media-metadata --params -
huntapi media-metadata --params params.json --compact
huntapi request get /v1/usage
huntapi request post /v1/some/new/endpoint --params body.json
huntapi media-metadata --query 'https://www.youtube.com/watch?v=Z5YP8kznWZs' | jq .

Exit codes

  • 0: success
  • 1: API or network failure
  • 2: invalid usage, such as an unknown command, a missing API key or a missing parameter

On this page