Skip to content

Requests and elements

API requests allow you to get or send data from external services. By combining them with events or element settings in Wized, you can transform that data into concrete actions, creating an interactive and dynamic experience on your website.

Practical Examples

Show the current weather in your city:

  • Makes a request to a weather API to get the temperature and weather conditions at the user's location.
  • Set Text setting to display this information in a text element on your page.

Recommend products based on purchase history:

  • Sends a request to a recommendation API with the user's purchase data.
  • Render List setting to display a dynamic list of recommended products.

Allow users to filter products by category:

  • Get a complete list of products from an API.
  • Render List configuration to display the products, and add conditional logic in the Function Editor to filter them based on the category selected by the user.

Display a custom welcome message:

  • If the user is logged in, get their name from an API or cookie.
  • Set Text setting to display a message like "Hello, [user name]!" in a text element.

Hide a button if a product is out of stock:

  • Makes a request to an API to check product availability.
  • Use the Set Visibility setting to hide the "Buy" button if the product is not available.