$npx -y skills add abra5umente/api-proxy --skill skillRoutes API requests through the user's residential proxy to bypass cloud IP blocks. TWO use cases - (1) Runtime fallback when direct curl/fetch fails with 403/blocked errors, use fetch.py for quick retry. (2) Template for building new skills that need proxy routing, copy proxy_he
| 1 | # API Proxy Skill |
| 2 | |
| 3 | Routes requests through residential IP via `proxy.address.here.com`. |
| 4 | |
| 5 | ## Runtime Fallback (ad-hoc) |
| 6 | |
| 7 | When a direct request fails with 403 or IP blocking, retry through the proxy: |
| 8 | |
| 9 | ```bash |
| 10 | # Simple GET |
| 11 | python3 /mnt/skills/user/api-proxy/scripts/fetch.py "https://api.example.com/endpoint" |
| 12 | |
| 13 | # POST with body |
| 14 | python3 /mnt/skills/user/api-proxy/scripts/fetch.py "https://api.example.com/endpoint" POST '{"key": "value"}' |
| 15 | ``` |
| 16 | |
| 17 | Returns JSON response or `{"error": "message"}` on failure. |
| 18 | |
| 19 | ## Template Mode (building skills) |
| 20 | |
| 21 | When creating skills that need proxy routing: |
| 22 | |
| 23 | 1. Copy `proxy_helper.py` into the new skill's `scripts/` folder |
| 24 | 2. Import and use: |
| 25 | |
| 26 | ```python |
| 27 | from proxy_helper import proxy_get, proxy_request |
| 28 | |
| 29 | data = proxy_get("https://api.example.com/endpoint") |
| 30 | |
| 31 | data = proxy_request( |
| 32 | url="https://api.example.com/endpoint", |
| 33 | method="POST", |
| 34 | headers={"Authorization": "Bearer xyz"}, |
| 35 | body='{"key": "value"}' |
| 36 | ) |
| 37 | ``` |
| 38 | |
| 39 | ## Proxy Details |
| 40 | |
| 41 | ``` |
| 42 | URL: https://proxy.address.here.com/proxy |
| 43 | Token: your_token_here |
| 44 | ``` |
| 45 | |
| 46 | ## Currently Whitelisted Domains |
| 47 | |
| 48 | - `reddit.com`, `www.reddit.com`, `oauth.reddit.com` |
| 49 | |
| 50 | New domains require user to add them to `ALLOWED_DOMAINS` env var and restart the container. |
| 51 | |
| 52 | ## Troubleshooting |
| 53 | |
| 54 | | Error | Cause | Fix | |
| 55 | |-------|-------|-----| |
| 56 | | 403 from proxy | Domain not whitelisted | Ask user to whitelist | |
| 57 | | 503 from proxy | Rate limited | Retry after delay | |
| 58 | | 504 from proxy | Upstream timeout | Increase timeout | |
| 59 | | Connection refused | Container/tunnel down | Check status | |