Quickstart
1. Get an API key
Go to data.build.ai/get-access and sign in with Google. If you have a@build.ai email you’ll get a key instantly. Otherwise, request access and we’ll get back to you.
Copy
Ask AI
export BUILDAI_API_KEY="build_live_..."
2. Browse a factory
- Python
- curl
Copy
Ask AI
from buildai import Client
client = Client()
factories = client.factories.list(page_size=3)
for factory in factories.items:
print(factory.factory_id, factory.name, f"{factory.clip_count} clips")
Copy
Ask AI
curl -s https://api.data.build.ai/v1/factories?page_size=3 \
-H "X-API-Key: $BUILDAI_API_KEY"
3. Watch a clip
- Python
- curl
Copy
Ask AI
clips = client.clips.list(factory_id="FACTORY_ID", page_size=1)
clip = clips.items[0]
# Get a signed URL and open it
video = client.clips.video(clip.clip_id)
print(video.signed_url) # paste in browser to watch
# Or download it
import requests
resp = requests.get(video.signed_url)
with open("clip.mp4", "wb") as f:
f.write(resp.content)
Copy
Ask AI
# Get clips
curl -s "https://api.data.build.ai/v1/clips?factory_id=FACTORY_ID&page_size=1" \
-H "X-API-Key: $BUILDAI_API_KEY"
# Get a signed video URL — open it in your browser
curl -s "https://api.data.build.ai/v1/clips/CLIP_ID/video" \
-H "X-API-Key: $BUILDAI_API_KEY"
4. View frames
- Python
- curl
Copy
Ask AI
from IPython.display import Image, display
frames = client.clips.frames(clip.clip_id, page_size=5)
for frame in frames.items:
print(f"frame {frame.frame_index} @ {frame.timestamp_seconds}s — {frame.width_pixels}x{frame.height_pixels}")
display(Image(url=frame.image_url, width=400)) # renders in Jupyter
Copy
Ask AI
curl -s "https://api.data.build.ai/v1/clips/CLIP_ID/frames?page_size=5" \
-H "X-API-Key: $BUILDAI_API_KEY"
5. Search for something
- Python
- curl
Copy
Ask AI
results = client.search("person soldering a circuit board")
for match in results.items:
print(f"{match.similarity_score:.3f} — {match.match_summary}")
if match.preview_image_url:
display(Image(url=match.preview_image_url, width=400))
Copy
Ask AI
curl -s https://api.data.build.ai/v1/search \
-H "X-API-Key: $BUILDAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query_text": "person soldering a circuit board", "page_size": 5}'
6. Get a dataset
- Python
- curl
Copy
Ask AI
datasets = client.datasets.list()
for ds in datasets.items:
print(ds.name, f"{ds.clip_count} clips")
# Get WebDataset shard URLs for training
urls = client.datasets.webdataset_urls(datasets.items[0].name)
print(f"{len(urls)} shards ready for training")
Copy
Ask AI
curl -s https://api.data.build.ai/v1/datasets \
-H "X-API-Key: $BUILDAI_API_KEY"