CLI Reference

pikeway inspect

See exactly what an endpoint expects and what it costs, plus a ready-to-run pikeway run command. Free, no key needed.

Synopsis

bash
pikeway inspect -p <provider> -e <endpoint> [-m <method>] [--json]

Description

Calls POST /v1/inspect and prints the API name, method, path and price, the description, then the path and query parameters (required ones marked *, with type, allowed values and description) and the JSON body schema if there is one. Notes from the API owner follow.

The last line is a complete pikeway run command filled in with the endpoint's example input, so you can copy it, change the values and run it. -m is added to that line only for non-GET methods.

Options

--provider, -pstringrequired
API slug, as shown by discover (e.g. birdeye).
--endpoint, -estringrequired
Endpoint path. Either the template (/tvl/{protocol}) or a concrete path (/tvl/aave) works.
--method, -mstring
HTTP method. Only needed when the same path has several methods; otherwise the gateway picks the one that exists.

Examples

bash
# the usual next step after discover
pikeway inspect -p birdeye -e /defi/price

# pick the POST variant of a path that also has GET
pikeway inspect -p someapi -e /reports -m POST

# a concrete path is matched against its template
pikeway inspect -p defillama -e /tvl/aave

# get just the input schema and example
pikeway inspect -p birdeye -e /defi/price --json | jq '{input, exampleInput}'

Output

text
Birdeye (birdeye)  GET /defi/price  $0.001/call
Current price of a token by mint address

query parameters:
  * address string  Token mint address

next: pikeway run -p birdeye -e '/defi/price' -i '{"queryParams":{"address":"So11111111111111111111111111111111111111112"}}'

For an endpoint with a JSON body and owner notes:

text
Some API (someapi)  POST /reports  $0.01/call
Generate a usage report

JSON body schema:
{
  "type": "object",
  "properties": {
    "range": { "type": "string", "enum": ["7d", "30d", "90d"] }
  },
  "required": ["range"]
}
note: reports over 90 days can take a few minutes; use --wait

next: pikeway run -p someapi -e '/reports' -m POST -i '{"body":{"range":"30d"}}'

--json

The full /v1/inspect response: input (JSON Schemas for pathParams, queryParams, body), exampleInput, price, notes, hints and, when published, responses.

json
{
  "provider": "birdeye",
  "providerName": "Birdeye",
  "endpoint": "/defi/price",
  "method": "GET",
  "description": "Current price of a token by mint address",
  "input": {
    "queryParams": {
      "type": "object",
      "properties": { "address": { "type": "string", "description": "Token mint address" } },
      "required": ["address"]
    }
  },
  "exampleInput": { "queryParams": { "address": "So11111111111111111111111111111111111111112" } },
  "price": { "type": "PER_CALL", "amount": { "value": 0.001, "currency": "USD" } },
  "notes": [],
  "hints": { "inspect": "…", "run": "…", "docs": "…" }
}

Errors and exit codes

ExitMessageWhen
2missing --provider-p was not given (or given without a value).
2missing --endpoint-e was not given.
1unknown provider: birdeyeeNo API with that slug.
1unknown endpoint /price on birdeyeNo such path. With --json, details.available lists the endpoints that do exist.
1cannot reach <gateway>: ECONNREFUSEDThe gateway could not be reached (DNS, network, wrong PIKEWAY_API_BASE_URL). The code after the colon comes from Node.
  • Not sure of the path? Run pikeway discover first, or use --json on a wrong path to get the list of valid ones.
Also accepts the global flags -j, --json and -k, --key. See Global flags and Exit codes.