CLI tool for TikTok proxy API
npm install @dimension-studios/ttk-proxyCLI tool for TikTok Proxy API - A simple command-line interface to interact with the TikTok proxy service.
``bash`
npm install -g @dimension-studios/ttk-proxy
The CLI uses conf to store your API credentials. You can configure it in two ways:
Set the following environment variables:
`bash`
export TTK_FETCH_API_URL="https://your-api-url.com"
export TTK_FETCH_API_KEY="your-api-key"
export TTK_FETCH_API_SECRET="your-api-secret"
Then run the config command to save them:
`bash`
ttk-proxy config
`bash`
ttk-proxy config:set apiUrl "https://your-api-url.com"
ttk-proxy config:set apiKey "your-api-key"
ttk-proxy config:set apiSecret "your-api-secret"
`bash`
ttk-proxy config --show
`bash`
ttk-proxy config --clear
Make a call to the TikTok proxy API with a JSON body:
`bash`
ttk-proxy call '{"shopId":"your-shop-id","url":"https://api.tiktok.com/endpoint","method":"GET"}'
Example with more complex body:
`bash`
ttk-proxy call '{
"shopId": "shop-123",
"url": "https://api.tiktok.com/v1/shops/products",
"method": "GET",
"headers": {
"Content-Type": "application/json"
},
"unofficialApi": {
"addCookieToHeaders": true,
"signUrl": true
}
}'
#### Base64 Support
You can also pass the JSON body as a base64-encoded string. The CLI will automatically detect and decode it:
`bashFirst encode your JSON to base64
echo -n '{"shopId":"shop-123","url":"https://api.tiktok.com/endpoint","method":"GET"}' | base64
This is useful when copying request bodies from logs or other sources where the JSON is already base64-encoded.
$3
List all available TikTok proxy tokens:
`bash
ttk-proxy list
`Output
The CLI provides beautiful, color-coded output using
@rharkor/logger:- ✅ Success messages in green
- ❌ Error messages in red
- ℹ️ Info messages in blue
- ⚠️ Warning messages in yellow
Example output:
`
🚀 Calling TikTok Proxy API...
✅ Status: 200 OK📦 Response:
{
"code": 0,
"data": {
"products": [...]
},
"message": "success"
}
`API Reference
$3
####
ttk-proxy call Call the TikTok proxy API with a JSON body.
- Arguments:
-
body (string): Stringified JSON body for the request (can be raw JSON or base64-encoded JSON)####
ttk-proxy listList all TikTok proxy tokens.
####
ttk-proxy config [options]Manage configuration.
- Options:
-
-s, --show: Show current configuration
- -c, --clear: Clear all configuration####
ttk-proxy config:set Set a configuration value.
- Arguments:
-
key (string): Configuration key (apiUrl, apiKey, or apiSecret)
- value (string): Configuration valueDevelopment
$3
`bash
Install dependencies
npm installBuild the package
npm run buildRun type checking
npm run type-checkDevelopment mode (watch)
npm run dev
`$3
`bash
Link the package globally
npm linkNow you can use ttk-proxy command
ttk-proxy --help
``ISC
Dimension Studios
For issues and questions, please open an issue on the GitHub repository.