# Passing dynamic data when rendering Builder content with the HTML API

**URL:** <https://forum.builder.io/t/passing-dynamic-data-when-rendering-builder-content-with-the-html-api/540>\
**Category:** Technical FAQs\
**Tags:** api, html\
**Created:** [March 27, 2021, 3:09am UTC](https://forum.builder.io/t/passing-dynamic-data-when-rendering-builder-content-with-the-html-api/540 "2021-03-27T03:09:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![armando](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@armando](https://forum.builder.io/u/armando)\
**Post date:** [March 27, 2021, 3:09am UTC](https://forum.builder.io/t/passing-dynamic-data-when-rendering-builder-content-with-the-html-api/540/1 "2021-03-27T03:09:13Z")

</div>

You can [bind](https://www.builder.io/c/docs/guides/state-and-actions) values to specific state keys, which will be available to blocks’ bindings and the Javascript code you add to your content. For example, if you add a text block, and [bind](https://www.builder.io/c/docs/guides/state-and-actions) its content to a state variable, like `state.myCustomTextValue`, the HTML API lets you alter the value of this parameter using query string parameters, like:

```auto
curl --request GET \
  --url 'https://builder.io/api/v1/html/page?=&apiKey=$API_KEY&url=%2Fdemo-page&data.textFromState=a%20string'

```

- `page` in the URL path is the model’s name
- The `apiKey` parameter is your public API key
- The `url` parameter is the value of the “Url” field of the content

The interesting query parameter here is `data.textFromState`: it can be anything that can be deserialized using JSON/JSON5, or if deserialization fails, it will be kept as a string. Note that to be correctly transferred as part of a URL, this value has to be also URL-encoded. Then you should be able to access these values from your blocks’ bindings and your content’s JS code.

- `data.someField=a%20string` ➡ `state.someField === "a string"`
- `data.someField=%22a%20string%22` ➡ `state.someField === "a string"`
- `data.someField=42` ➡ `state.someField === 42`
- `data.someField=true` ➡ `state.someField === true`
- `data.someField=false` ➡ `state.someField === false`

Note that these example values have double quotes (and they are URL-encoded)

- `data.someField=%2242%22` ➡ `state.someField === "42"`
- `data.someField=%22true%22` ➡ `state.someField === "true"`
- `data.someField=%22false%22` ➡ `state.someField === "false"`

Since these values can be arbitrary values as long as they are in JSON, you can use this to set more complex values, like array and objects:

- `data.someField=%7B%22name%22%3A%22Betty%22%2C%22engineer%22%3Atrue%7D` ➡ `state.someField == { name: 'Betty', engineer: true }`
- `data.someField=%5B-42%2C0%2C42%5D` ➡ `state.someField == [-42, 0, 42]`

Generalizing, the value of all query string parameters that are prefixed with `data.` will be available in your bindings without the `data.` prefix and after being deserialized using the JSON5 parser. If any value fails to be deserialized it will be kept as a string.
