Overview
A public, read-only GraphQL API that each Basker site serves for headless front ends
The FrontStage API is a public, read-only GraphQL API. Each Basker site serves it at https://<site-host>/graphql, for example https://www.example.org/graphql. Use it to build a site in Astro, Next.js, or any other framework, with Basker as the content source.
curl -s -G https://www.example.org/graphql \
--data-urlencode 'query={ site { name defaultLocale locales { code } } }'{
"data": {
"site": {
"name": "Remarkable Theatre",
"defaultLocale": "en",
"locales": [{ "code": "en" }, { "code": "es" }]
}
}
}What the API covers
One endpoint returns everything a public site needs:
- Routing: resolve any URL to a record, a redirect, or the 404 page. List every public URL for static builds and sitemaps.
- Content: pages, posts, blogs, events, event instances, people, works, venues, organizations, seasons, and series.
- Custom data: custom attributes, custom objects, smart collections, theme settings, and template settings.
- Blocks: custom-theme blocks and website builder blocks, with their settings and resolved data.
- Rich text and media: rich text as HTML, plain text, or editor JSON. Images with on-the-fly resizing.
- Events and ticketing: performances in a date window, with booking status from the installed ticketing app.
- Search, forms, navigation, and announcements.
The API returns published content only. It never returns drafts, hidden event instances, custom objects that are not exposed in the public API, or data from apps that the site has not installed.
How it works
- Public. Requests need no API key. The site comes from the host name in the URL.
site.urlreturns the origin of the site. - Read-only. The schema has no mutations.
- GET only. Send each query in the URL. Basker caches successful responses at the edge. See Requests and Caching.
- Persisted queries. Send a SHA-256 hash in place of a long query. See Persisted queries.
- Any origin. Browsers on any domain can call the API. Responses carry
Access-Control-Allow-Origin: *. - One schema for every site. Custom attributes, custom objects, and theme settings use one shared
Fieldinterface. See Content model.
Choose an API
| FrontStage API (GraphQL) | FrontStage REST API | Partners API | |
|---|---|---|---|
| Use it for | Headless sites and new integrations | Existing themes and widgets | Server-side syncs and content changes |
| Host | Your site: https://<site-host>/graphql | Your site: https://<site-host>/api/... | https://api.basker.app/partners/... |
| Authentication | None | None | API key |
| Methods | GET | GET | GET, POST, PATCH, PUT, DELETE |
| Content | Published, public content | Published, public content | Drafts and published content, as the key allows |
| Writes | No | No | Yes |
| Edge cache | Yes | Yes | No |
| Shape | You choose the fields | Fixed JSON per endpoint | Fixed JSON per endpoint |
Use the Partners API when you need to read drafts, change content, or keep a secret key on a server. Use the FrontStage API for everything that a site visitor can see.