Resources
4Install
npx skillscat add famaoai-creator/gemini-skills/api-fetcher Install via the SkillsCat registry.
About this skill
The api-fetcher skill enables a program to retrieve data from REST or GraphQL endpoints by sending HTTP requests with configurable headers and body, handling errors such as malformed JSON or connection issues. It is used when an agent or developer needs to programmatically obtain external data securely within a Node.js environment.
SKILL.md
Api Fetcher
Fetch data from REST/GraphQL APIs securely.
Usage
node api-fetcher/scripts/fetch.cjs [options]
Options
| Flag | Alias | Type | Required | Description |
|---|---|---|---|---|
--url |
-u |
string | Yes | Target URL |
--method |
-m |
string | No | HTTP method (default: GET) |
--headers |
-H |
string | No | JSON string of request headers |
--body |
-b |
string | No | JSON string of request body |
--out |
-o |
string | No | Output file path |
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
Invalid headers: Unexpected token |
Malformed JSON in --headers |
Ensure valid JSON: --headers '{"Authorization":"Bearer token"}' |
Invalid request body: Unexpected token |
Malformed JSON in --body |
Validate JSON before passing |
ECONNREFUSED |
Target server is down or unreachable | Check URL and network connectivity |
ETIMEDOUT |
Request timed out | Verify server availability, check firewall rules |
ENOTFOUND |
DNS resolution failed | Check URL spelling, verify DNS settings |
Request failed with status code 4xx/5xx |
Server returned an error | Check authentication, request format, API docs |
Knowledge Protocol
- This skill adheres to the
knowledge/orchestration/knowledge-protocol.md. It automatically integrates Public, Confidential (Company/Client), and Personal knowledge tiers, prioritizing the most specific secrets while ensuring no leaks to public outputs.