CLI Usage

Command-line interface usage examples

Command Line Usage Examples

## install for CLi testing of your APIs
npm i -g grab.api.js

# use "grab" if installed or "npx grab-url" if not
grab https://api.example.com/download

# Basic request, no flag
npx grab-url https://api.example.com/download

# Request with params
npx grab-url https://api.example.com/download id=123 name=John

# Request with JSON payload
npx grab-url https://api.example.com/download '{"id":123,"name":"John"}'

# Request with --x flag (just executes once, no watching)
# - **`--x` or `-x` flag**: Simply executes the request/download once and exits—no file watching.
npx grab-url https://api.example.com/download --x

# Request with params and --x flag
npx grab-url https://api.example.com/download id=123 name=John --x

On this page