Getting Data
To use your API in the developer dashboard, it will need to be allowlisted by You.com. Please reach out via email at [email protected] for more details. To get started, you can paste sample data into the data editor to create your template.
This section will cover how to call your API onload
and use that data to render your app.
If you want to use your API based on some sort of user action/input, use the configuration described in
sending data with a form.
All API calls will be proxied through You.com's servers to mask identifying details of users such as IP addresses, and user agents.
To get started with an API, follow the example below. You will need to add an api
object at the top level of the template, as well as a appName (string)
.
The appName
is mainly used to append API keys to requests if you need to store a private API key in our servers.
- Usage
- Props
- Params
- Headers
url: "https://your-api-endpoint.com",
method: "POST" | "GET"
headers: { // these will be included with the POST/GET
key: "value",
otherKey: "otherValue"
},
params: [
// see params tab for more details
{
use_query: true,
param_name: "q"
},
{
param_name: "some_string",
value: "some value"
}
]
params
field. Query parameters can either be fixed or dynamic based on the user's search query.To use the user's search query, follow the pattern below
params: [
{
use_query: true,
param_name: "some_name"
}
]
params: [
{
value: "some_value",
param_name: "some_name"
}
]
headers: {
X-Private-API-Key: "{{ USE_API_KEY KEY_NAME }}"
}