SDKs & code examples

There's no SDK to install — it's plain HTTP with a JSON body. Here's the same call in three languages.

cURL

curl -X POST "https://api.buildwithapi.io/v1/actors/github-repo/run-sync-get-dataset-items" \
  -H "X-API-Key: vk_live_..." -H "Content-Type: application/json" \
  -d '{"owner":"torvalds","repo":"linux"}'

Python

import requests

def run(actor, payload, key="vk_live_..."):
    r = requests.post(
        f"https://api.buildwithapi.io/v1/actors/{actor}/run-sync-get-dataset-items",
        headers={"X-API-Key": key, "Content-Type": "application/json"},
        json=payload, timeout=60,
    )
    r.raise_for_status()
    return r.json()["items"]

print(run("github-repo", {"owner": "torvalds", "repo": "linux"}))

Node (fetch)

async function run(actor, payload, key = "vk_live_...") {
  const res = await fetch(
    `https://api.buildwithapi.io/v1/actors/${actor}/run-sync-get-dataset-items`,
    { method: "POST",
      headers: { "X-API-Key": key, "Content-Type": "application/json" },
      body: JSON.stringify(payload) });
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
  return (await res.json()).items;
}

run("github-repo", { owner: "torvalds", repo: "linux" }).then(console.log);

Tip: keep your key in an environment variable (VECTOR_API_KEY), never in client-side code.