Hostinger AI Builder: How to integrate a third-party API in agentic mode

Integrate a third-party API into your Hostinger AI Builder agentic mode website.

Updated 6 days ago

Integrate a third-party API into your Hostinger AI Builder agentic mode website to add advanced features like payment processors, real-time data feeds, and automation tools. Hostinger AI Builder handles the backend code for you, supporting common use cases such as:

  • Payment processors: Integrating services like PayPal or Stripe.
  • Content APIs: Displaying live data such as weather, news, or specialized databases.
  • Automation: Connecting to tools to sync user data.

Before you start

Before prompting, gather the following details from your API provider:

  • API key (if required): If the API needs a key, such as a Stripe or OpenAI API key, have both your test key and live key ready. You add them in Secrets, not in the chat.
  • Documentation URL: The specific endpoint structure and parameters.
  • Functional requirements: A clear description of what the API should do (e.g., “display data” or “trigger an action”).

Step 1 – Prompt to set up the integration

In the Hostinger AI Builder chat, describe the connection you want to establish. Provide the technical details directly in the chat.

Example prompt for a content API:

Integrate a public weather API into my website. Display the current weather for London on the homepage every time the page loads.

Example prompt for a payment API:

Integrate the PayPal API into my website. Add a Pay Now button to the checkout page.

When Hostinger AI Builder needs a key, it shows a secure card in the chat where you enter the value. The value never appears in the conversation.

Be as specific as possible regarding where the feature should appear and what happens after a user interacts with it.

Step 2 – Test the integration

  1. Once the integration is generated, click Preview to open your site.
  2. Trigger the feature, such as loading the page or clicking a button.
  3. Confirm the expected result, such as data loading or a confirmation message appearing.
  4. If the feature does not work, describe the specific error to the Hostinger AI Builder chat and ask for a fix.

Step 3 – Publish your website

Once the integration works correctly in the preview mode:

  1. Click Publish in the editor.
  2. Before publishing, add a Live value for each secret in Secrets. Your published site uses the Live value, while the preview keeps using the Test value. If a secret has a Test value but no Live value, a warning appears when you publish.

Build a data app in Hostinger AI Builder

Hostinger AI Builder agentic mode builds data apps: web apps that pull data from an external API and display it on your site. If the API needs a key, add it in Secrets. Hostinger AI Builder chooses how often to refresh the data based on what your app needs, using one of three approaches:

  • Load on request – the app fetches the data each time a visitor opens it. This suits data that rarely changes, such as encyclopedia or reference content.
  • Scheduled load – the app stores the data in its database and updates it in the background on a schedule. This suits product price aggregators, parcel trackers, and apps that send alerts or notifications.
  • Real-time load – the app keeps a live connection to the data provider and updates continuously. This suits cryptocurrency exchange rates, stock prices, and sensor data.

Describe the data source and how up to date the data needs to be in your prompt. For example: Build a dashboard that shows live Bitcoin and Ethereum prices from a public crypto exchange API.

Store API keys in Hostinger AI Builder Secrets

Secrets keeps API keys for services like Stripe or OpenAI out of the chat and out of your project files. Each secret has a Test value for the preview and a Live value for your published site. See Hostinger AI Builder: How to store API keys with Secrets in agentic mode for how to add, edit, and delete secrets.

Your Hostinger AI Builder website is now connected to an external service, extending its functionality beyond standard features. You can continue to add more integrations as your site grows.

For an overview of how integrations work and other common examples, see how to use integrations in agentic mode.