Call an API endpoint
agent-data call requests data from an operation in a catalog API. Read the API’s current contract for its route and required inputs.
Select the API and operation
Section titled “Select the API and operation”agent-data call <api-reference> <route-slug> --<parameter> <value><api-reference> means an API handle or listing ID. The handle youtube-com and listing ID e5182587-a7c9-4668-a8a6-314458afef40 identify the same API. This argument is not a documentation URL.
<route-slug> names an operation inside that API. For example, search-videos selects YouTube search at HTTP path /v1/search-videos.
--query "python programming" supplies the operation’s required query parameter. --dry-run and --input-json control the CLI itself.
- Preview the request with
--dry-run. - Execute the request without
--dry-run.
agent-data call youtube-com search-videos --query "python programming" --dry-runagent-data call youtube-com search-videos --query "python programming"The CLI prints the response body to standard output. See usage for call costs.
Use Bash or zsh with your API key in AGENT_DATA_API_KEY. Use api.base_url and the route path from the current contract.
This request uses the branded address checked on November 17, 2026.
curl --fail-with-body --silent --show-error --get \ -H "Authorization: Bearer $AGENT_DATA_API_KEY" \ --data-urlencode 'query=python programming' \ 'https://api.agent-data.dev/youtube-com/v1/search-videos'--data-urlencode supplies the query string. This GET request has no body.
Call the call tool in your connected MCP client.
{ "listing_id": "youtube-com", "route": "search-videos", "params": { "query": "python programming" }}Pass the API handle in listing_id. route selects its operation. params contains the operation’s inputs.
Read the JSON in the returned text content. See the MCP reference for optional inputs and HTTP response details.
Preview output
Section titled “Preview output”--dry-run resolves the request without a data call. It may read the current contract.
This CLI 0.13.0 preview comes from November 17, 2026. The excerpt omits all headers, including the masked credential.
{ "dry_run": true, "method": "GET", "url": "https://api.agent-data.dev/youtube-com/v1/search-videos?query=python+programming", "body": null}Supply typed inputs
Section titled “Supply typed inputs”Use --input-json for explicit input locations and JSON types.
agent-data call youtube-com search-videos \ --input-json '{"query":{"query":"python programming"}}' \ --dry-runThe outer query selects the query-string location. The inner query names this operation’s input. This preview resolved the same request shown above.
The typed input object accepts path, query, header, and body. The request-input reference shows real path and typed-query previews and explains body syntax.
Recognize a successful result
Section titled “Recognize a successful result”The CLI returned this first item on November 14, 2026. HTTP and MCP returned it on November 17, 2026. The excerpt omits other fields, other items, and the continuation value.
{ "items": [ { "video_id": "fWjsdhR3z3c", "title": "Learn Python in Less than 10 Minutes for Beginners (Fast & Easy)", "channel_name": "Indently", "duration": "10:30", "duration_seconds": 630, "publication_information": "5 years ago", "video_url": "https://www.youtube.com/watch?v=fWjsdhR3z3c" } ]}duration_seconds contains numeric seconds. duration and publication_information contain source text. The get data guide explains the fields and links to the complete captured items.
CLI options
Section titled “CLI options”| Option | Effect |
|---|---|
--method <method> | Select the HTTP method. Omit it to use the contract’s method. |
--dry-run | Print the request without a data call. |
--input-json <json> | Supply typed inputs at explicit locations. |
--api-key <key> | Override the configured credential. |
--base-url <url> | Select the marketplace service for contract requests. |
--verbose | Print diagnostics to standard error. See private fields. |
-h, --help | Show command help. |
Recover from a missing input
Section titled “Recover from a missing input”Without --query, the preview exits with status 1. It returns this actual error before a data request.
{ "error": { "status": 400, "body": null, "source": "cli", "code": "missing_required_param", "message": "Missing required parameter: query (in: query)", "param": "query", "retryable": false }}Add --query "python programming" because the operation requires a search query. The corrected command above returned the captured video data.
source: "cli" identifies local validation. The 400 value does not represent an upstream HTTP response.
| What you see | What to do |
|---|---|
| An authentication error. | Check the credential with agent-data auth status. |
| An allowance or spending error. | Check account status and usage controls. |
| A source error. | Follow source-error recovery. |
When to use another guide
Section titled “When to use another guide”Use the get data guide for setup and API discovery. Use typed inputs for path parameters, headers, or JSON bodies.