BUILDER

Resources

Ɨ

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

ā˜°

Home

Forum

Blog

Github

Login

Signup

This page was made in Builder!

Builder HTML API

Usage

With the HTML API you can have Builder prerender your components server-side. This makes it a breeze to integrate Builder into pretty much any set up you might have. The best way to get familiar with the API is to explore it using your personalized api explorer, which you can find by clicking the blue button below.

Try Out the Interactive API Explorer

Sample Request and Response

https://builder.io/api/v1/html/YOUR_MODEL_NAME?apiKey=YOUR_API_KEY&url=PAGE_URL

# Example response
# {
#   "id": "c923kd89",
#   "name": "About page",
#   "data: {
#     "html": "<div data-builder-component="banner-ad"><div class="builder-blocks"><h1>Hello!</h1></div></builder-div>"
#   }
# }

Query params

NameRequiredDescription

apiKey

Yes

Your API key

url

Yes

The current URL of the visitor on your site, e.g. ?url=https://your-site.com/about?foo=bar

includeUnpublished

No

Set to true to include unpublished content in your API response (e.g. for testing)

query.*

No

Mongodb style query of your data. E.g.:

&query.data.id=abc123
&query.data.myCustomField=someValue
&query.data.someNumber.$ne=20

fields

No

Only include these fields. E.g.

&fields=id,name,data.customField

omit

No

Omit only these fields, E.g.:

&omit=data.bigField,data.blocks

userAttributes.*

No

Optionally use this to send targeting attributes, e.g.:

&userAttributes.device=desktop
&userAttributes.locale=en_us

cacheSeconds

No

Seconds to cache content (sets the max-age of the cache-control header response header). Make higher for better performance, and lower for content that will change more frequently

&cacheSeconds=120

format

No

Set this to amp to render amp content (the content must be made via an "amp" model type) or email to render email model content (the content must be made via an "email" model)

&format=amp

Up next

Content API

Questions or comments?

Give us a chat, we respond quickly and are here to help!

Chat Us Now
Was this article helpful?