Arcade Python API Client

1.10.0 · active · verified Thu Apr 16

The Arcade Python library provides convenient access to the Arcade REST API from any Python 3.8+ application. It includes type definitions for all request parameters and response fields, offering both synchronous and asynchronous clients powered by httpx. The library is frequently updated to reflect the latest API changes.

Common errors

Warnings

Install

Imports

Quickstart

Initializes the synchronous Arcade client using an API key from environment variables and demonstrates executing a sample tool. Ensure 'ARCADE_API_KEY' is set.

import os
from arcadepy import Arcade

# Ensure ARCADE_API_KEY is set in your environment variables
# e.g., export ARCADE_API_KEY="your_api_key_here"
client = Arcade(
    api_key=os.environ.get("ARCADE_API_KEY", "")
)

# Example: Execute a tool (replace with actual tool_name and input)
try:
    execute_tool_response = client.tools.execute(
        tool_name="Google.Search",
        input={
            "query": "latest news on AI models"
        },
        user_id="user@example.com", # Required for many tools requiring user context
    )
    print(f"Tool execution ID: {execute_tool_response.id}")
    print(f"Tool output: {execute_tool_response.output}")
except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →