REST API Caller

VerifiedCaution

Call REST APIs from Python, parse JSON responses, and extract useful fields to report back to the user.

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

Recommended for

Our review

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

Strengths

  • Directly uses Python code via execute_code to run requests.
  • Focuses on extracting relevant fields rather than dumping the full payload.
  • Handles authentication via tokens or API keys from environment variables.
  • Clearly reports HTTP errors and missing information.

Limitations

  • Requires the execute_code tool to be available.
  • Relies on the requests library, which may not be installed.
  • Does not handle non-JSON APIs or complex streaming responses.
When to use it

When data needs to be fetched from a REST API and summarized concisely for the user.

When not to use it

For simple API calls better handled by another tool, or when Python execution is not available in the environment.

Security analysis

Caution
Quality score88/100

The skill uses powerful execute_code and network access for legitimate API calling, but it does not include destructive or obfuscated instructions. The risk is similar to any code execution tool, so caution is warranted.

Findings
  • Uses execute_code to run arbitrary Python, which could perform unintended actions if the agent is compromised or the user request is malicious.
  • Makes network requests to user-specified endpoints, which could be used to exfiltrate data if combined with a malicious API or instruction.
  • Reads environment variables for tokens/API keys, which risks exposing secrets if the script prints them inadvertently.

Examples

Fetch random joke
Use the REST API skill to get a random joke from https://official-joke-api.appspot.com/random_joke and show me the setup and punchline.
List GitHub repos
Call the GitHub API to list my public repositories. Use the GITHUB_TOKEN environment variable for authentication and return only the repository names and URLs.
Check weather
Get the current weather for Paris from the Open-Meteo API at https://api.open-meteo.com/v1/forecast?latitude=48.85&longitude=2.35&current_weather=true and tell me the temperature and wind speed.

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