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.
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
Name | Required | Description |
---|---|---|
apiKey | Yes | Your API key |
url | Yes | The current URL of the visitor on your site, e.g. |
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.:
|
fields | No | Only include these fields. E.g.
|
omit | No | Omit only these fields, E.g.:
|
userAttributes.* | No | Optionally use this to send targeting attributes, e.g.:
|
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
|
format | No | Set this to
|