Skip to main content
API Integrations are connections to external services and data providers available through the Marketplace. They bring structured data from hundreds of APIs into your Space — ready to query with natural language.

How API Integrations Work

API Integrations are registered as providers in the Marketplace. Each provider exposes one or more endpoints — specific data queries with defined parameters and output. When Zark discovers a provider through the Marketplace, its endpoints become available for your request.

Provider Types

TypeDescriptionExamples
Built-inPre-configured providers maintained by Zark LabCore analytics, market data
CommunityProviders built and published by the communitySocial analytics, sports data, specialized APIs
CustomProviders you configure with your own API keysAny REST API with a defined schema

Using a Provider via the API

Providers are discovered automatically. Just ask your question and Zark finds the right one:
import requests

response = requests.post(
    "https://api.zarkai.xyz/v1/chat",
    headers={
        "x-api-key": "your_api_key",
        "Content-Type": "application/json",
    },
    json={
        "messages": [
            {"role": "user", "content": "Show me the top DEX pools by TVL on Ethereum"}
        ],
        "workspace_id": "wks-xxxxx",
        "tool_choice": "auto",
    },
)

data = response.json()
print(data["response"])
Zark extracts parameter values from your natural language query. Asking “top DEX pools on Ethereum over the last 7 days” maps to the right provider and parameters automatically.

Combining with Core Tools

API Integrations work alongside core tools for complex requests: “Get the top 10 DeFi protocols by TVL and create a comparison report” Zark fetches data from an API Integration, then passes the results to Artifact Creator to generate the document. “Find the highest-volume trading pairs and calculate statistical significance” Zark fetches data from an API Integration, then passes it to Code Runner for the computation.

Results

API Integration results include structured data that can be displayed as tables, saved to your Space, or passed to other tools for further analysis:
Python
import requests
import json

response = requests.post(
    "https://api.zarkai.xyz/v1/chat",
    headers={"x-api-key": "your_api_key", "Content-Type": "application/json"},
    json={
        "messages": [{"role": "user", "content": "Top DEX pools by TVL on Ethereum"}],
        "workspace_id": "wks-xxxxx",
        "stream": True,
    },
    stream=True,
)

for line in response.iter_lines():
    if line:
        event = json.loads(line.decode("utf-8").removeprefix("data: "))
        if event["type"] == "table":
            print(f"Results: {event['total_rows']} rows")
        elif event["type"] == "ai_chunk":
            print(event["content"], end="", flush=True)
        elif event["type"] == "ai_complete":
            print("\n\nDone.")

Streaming Events

EventDescription
tableStructured data with rows, columns, and metadata
ai_chunkAnalysis and interpretation of the results
ai_completeFinal response

Examples

Show me the top DEX pools by TVL on Ethereum
What's the 24-hour trading volume across chains?
Pull the latest social engagement metrics for this account
Get token price history for the last 30 days
Show me wallet risk scores for these addresses