Builder Content API
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 via url parameters to allow you to get exactly the data you need. 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.
Usage
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 via url parameters to allow you to get exactly the data you need. 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
Supported Query Params
Name | Required | Description |
---|---|---|
apiKey | Yes | Your API key |
userAttributes.* | No | Optionally use this to send targeting attributes, e.g.: |
query.* | No | Mongodb style query of your data. E.g.:
See more info on
MongoDB's query operators and format here. We support the following operators: |
fields | No | Only include these fields. E.g. |
omit | No | Omit only these fields, E.g.: |
limit | No | Max number of results to return. Default is 20, max is 100 |
offset | No | Results offset (for pagination). Default is 0 |
includeRefs | No | Include content of references in response |
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 |
staleCacheSeconds | No | Builder.io uses stale-while-revalidate caching at the CDN level. This means we always serve from edge cache and update caches in the background for maximum possible performance. This also means that the more frequently content is requested, the more fresh it will be. The longest we will ever hold something in stale cache is 1 day by default, and you can set this to be shorter yourself as well. We suggest keeping this high unless you have content that must change rapidly and gets very little traffic |
sort | No | Property to order results by, use 1 for |
includeUnpublished | No | Include unpublished (draft) content in the response, rather than the default only include published content |
noTraverse | No | Default is true, pass false to include Symbol json in the response, which is helpful if you want to render your page all at once like the case in Server-side rendering |