REST API Caller

VerifiedCaution

Call REST APIs from Python, parse JSON responses, and return useful fields. Requires execute_code tool.

Sby Skills Guide Bot
DevelopmentBeginner
108/29/2026
Claude Code
#rest-api#python#json#http#api-caller

Recommended for

Our review

This skill calls REST APIs from Python, parses JSON responses, and reports only the useful fields back to the user.

Strengths

  • Handles public and authenticated endpoints with tokens or API keys
  • Automatically extracts relevant fields instead of dumping the whole payload
  • Reports HTTP status codes or error messages clearly on failure
  • Leverages the familiar requests library in Python

Limitations

  • Requires the execute_code tool to be available in the environment
  • No built-in retry, rate limiting, or streaming support
  • Only designed for HTTP/JSON APIs, not other protocols
When to use it

Use this skill when you need to fetch data from a REST JSON API, whether public or token-authenticated.

When not to use it

Do not use it for non-JSON APIs, streaming responses, or when the user wants the raw response body.

Security analysis

Caution
Quality score90/100

The skill uses execute_code and network access for legitimate REST API calls. It does not instruct destructive or exfiltrating actions, but because it involves executing generated code and handling credentials, it warrants caution.

Findings
  • Skill instructs the agent to write and execute Python code (execute_code), which can perform arbitrary actions, including network requests.
  • Uses environment variables for tokens/API keys; if output handling is careless, secrets could be printed to user or logs.
  • No explicit guidance to avoid including secrets in output or to mask sensitive headers/responses.

Examples

Random joke API
Call https://official-joke-api.appspot.com/random_joke and show me the setup and punchline.
GitHub latest commit
Use the GitHub API to get the latest commit on repository octocat/Hello-World. Read the token from the environment variable GITHUB_TOKEN and return the commit message and author.
Custom authenticated GET
Call a REST API at https://api.example.com/data with header Authorization: Bearer mytoken, parse the JSON, and print the 'status' and 'count' fields.

name: rest-api-caller description: Call REST APIs from Python, parse JSON responses, and report the useful fields back to the user. allowed-tools: execute_code

REST API Caller

Use this skill when the user wants data fetched from an HTTP API, especially a REST endpoint that returns JSON.

This skill is intended for:

  • public GET endpoints
  • authenticated APIs using tokens or API keys
  • endpoints where the user specifies headers, query params, or environment variable names

Requirements:

  • The agent should have access to execute_code.

Workflow:

  1. Activate this skill when the task requires calling an API.
  2. If you need examples, call read_skill_file for references/examples.md.
  3. Write a short Python script that performs the request.
  4. Prefer the requests library if available in the environment.
  5. Prefer execute_code.
  6. Parse the response and print only the fields needed for the final answer.
  7. Summarize the API result clearly for the user.

Rules:

  1. Do not invent API responses. Run the request first.
  2. For JSON APIs, parse JSON and extract the relevant fields instead of dumping the whole payload unless the user asks for the raw body.
  3. If the user provides an environment variable name for a token or API key, read it from os.environ inside the script.
  4. If the endpoint requires auth and no credential source is provided, say what is missing.
  5. If the request fails, report the HTTP status code or error message clearly.
  6. Do not claim there is a generic execution-environment issue unless the tool call actually returned one.

Demo endpoint:

  • GET https://official-joke-api.appspot.com/random_joke

Expected behavior for the demo endpoint:

  • Fetch one random joke
  • Return the setup and punchline in a readable format
Related skills