Skip to content

feat: add apify api subcommand for direct API access#1076

Draft
patrikbraborec wants to merge 3 commits intomasterfrom
feat/apify-api-subcommand
Draft

feat: add apify api subcommand for direct API access#1076
patrikbraborec wants to merge 3 commits intomasterfrom
feat/apify-api-subcommand

Conversation

@patrikbraborec
Copy link
Copy Markdown
Contributor

Summary

Adds apify api — a general-purpose authenticated HTTP client for the Apify API, inspired by gh api.

  • apify api v2/users/me — make authenticated GET requests
  • apify api v2/acts --method POST --body '{...}' — create resources
  • apify api --list-endpoints — browse all 129 API endpoints (from bundled OpenAPI spec)

Features

  • HTTP methods via --method / -X (GET, POST, PUT, PATCH, DELETE)
  • Request body via --body / -d (JSON string or stdin with -)
  • Custom headers via --header / -H
  • --list-endpoints / -l — lists all available endpoints with color-coded methods and descriptions, powered by the Apify OpenAPI spec fetched at build time

Closes #1075

🤖 Generated with Claude Code

Add a general-purpose authenticated HTTP client for the Apify API,
similar to `gh api` in GitHub CLI. Supports GET/POST/PUT/PATCH/DELETE
methods, request body (including stdin), custom headers, and a
--list-endpoints flag powered by the bundled OpenAPI spec.

Closes #1075

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added t-c&c Team covering store and finance matters. tested Temporary label used only programatically for some analytics. labels Apr 8, 2026
- Add missing `return` after `printHelp()` to prevent fetch with undefined endpoint
- Make build resilient to network failures by falling back to committed api-endpoints.json
- Commit api-endpoints.json so fresh checkouts work without network access
- Wrap test cleanup in try/finally to prevent actor leak on assertion failure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@patrikbraborec patrikbraborec added t-dx Issues owned by the DX team. and removed t-c&c Team covering store and finance matters. labels Apr 8, 2026
…y params, and lint fix

Add support for positional HTTP method syntax (e.g. `apify api GET /v2/users/me`),
auto-prepend `v2/` prefix when omitted, add `--params` flag for query parameters,
use `getLoggedClientOrThrow` for auth, switch to `simpleLog` for output, validate
JSON body before sending, and fix prefer-destructuring lint error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-dx Issues owned by the DX team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add apify api subcommand as a general-purpose authenticated HTTP client for the Apify API

2 participants