With the Content API, you can make requests to retrieve data about any of your models within Builder. The Content API supports advanced query filtering with URL parameters to help you get exactly the data you need.
Use cases for querying data could include searches, populating content for a collection, or getting all links that meet certain criteria.
To access this data, write queries with dot notation and, optionally, MongoDB style operators.
For more details on querying, see the Querying Cheatsheet.
Name | Description |
---|---|
Use your API key when integrating with Builder. Using the JavaScript SDK:
Using the REST API:
| |
Optionally use to send targeting attributes. Using the React or Angular SDK:
Using the Qwik, Vue, Solid, Svelte, or React-Native SDK:
Using the REST API:
| |
MongoDB style query of your data. Using the React or Angular SDK:
Using the Qwik, Vue, Solid, Svelte, or React-Native SDK:
Using the REST API:
Builder supports the following operators: | |
Only include these fields. Using the React or Angular SDK:
Using the REST API:
| |
Omit only these fields. Using the React or Angular SDK:
Using the REST API:
| |
Max number of results to return. The default is Using the React or Angular SDK:
Using the Qwik, Vue, Solid, Svelte, or React-Native SDK:
Using the REST API:
| |
Use to specify an offset for pagination of results. The default is Using the React or Angular SDK:
Using the Qwik, Vue, Solid, Svelte, or React-Native SDK:
Using the REST API:
For more detail, see this forum post and this forum post. | |
Include content of references in response. Using the React or Angular SDK:
Using the Qwik, Vue, Solid, Svelte, or React-Native SDK:
Using the REST API:
| |
Seconds to cache content. This sets the maximum age of the cache-control header response header. Set value higher for better performance, and lower for content that changes frequently. Using the React or Angular SDK:
Using the REST API:
| |
Builder.io uses stale-while-revalidate caching at the CDN level. This means Builder always serves from edge cache and updates caches in the background for maximum possible performance. In this way, the more frequently content is requested, the fresher it is. The longest Builder holds something in stale cache is one day by default, but you can set this to be shorter if needed. We suggest keeping this high unless you have content that must change rapidly and gets very little traffic. Using the React or Angular SDK:
Using the REST API:
| |
Property to order results by. Use The key is what you're sorting on, so the following example sorts by Using the React or Angular SDK:
Using the REST API:
| |
Include unpublished content in the response, rather than the default, which only includes published content. Using the React or Angular SDK:
Using the Qwik, Vue, Solid, Svelte, or React-Native SDK:
Using the REST API:
| |
Though the default is Using the React or Angular SDK:
Using the Qwik, Vue, Solid, Svelte, or React-Native SDK:
Using the REST API:
|
To experiment with the Content API, you can use the Builder API Explorer, which offers a way for you to compose queries in your own Builder Space. This way, you can confirm that your queries are correct before editing your code base.
Looking to hire a 3rd party to help with your project?
Submit a project request and our partnerships team will reach out to connect you with an Expert from our partner ecosystem.