AI

Integrate Bright Data’s SERP API into an AI Agent in IBM watsonx

This guide shows you how to connect IBM watsonx Orchestrate AI agents with Bright Data’s SERP API for accurate, real-time search results.
15 min read
Watsonx_SERP API blog image

In this tutorial, you will discover:

  • How IBM watsonx supports AI agent development.
  • Why integrating Bright Data’s SERP API enhances IBM watsonx Orchestrate agents.
  • The exact steps to build an AI agent powered by Bright Data’s SERP API within IBM watsonx Orchestrate.

Let’s dive in!

What Is the AI Agent Building Feature in IBM watsonx?

IBM watsonx Orchestrate, an enterprise-ready generative AI and automation system, provides AI agent building capabilities. This solution gives you what you need to design, deploy, and manage autonomous AI agents that perform tasks, make decisions, and interact with business-critical systems.

Agent building in IBM watsonx is available through both a low-code web interface and a code-based approach via the Agent Development Kit (ADK) Python library. In this article, we will focus on the low-code workflow integration using the web application.

Agents in the Orchestrate service can collaborate through multi-agent orchestration, connect to various external tools, leverage RAG (Retrieval-Augmented Generation) for knowledge-grounded responses, and much more.

The platform also includes governance and observability features to ensure compliance, transparency, and performance monitoring. Once built, agents can be deployed across multiple channels such as web chat, Slack, Microsoft Teams, and others.

Why IBM watsonx Agents Need Access to Bright Data’s SERP API

Large language models, including those available in IBM watsonx, are limited by the data they were trained on. In simpler terms, their knowledge stops at a certain point in time.

That is why LLM tend to produce outdated or inaccurate responses. That problem becomes even more serious for AI agents tasked with making decisions or producing reports to support decision-making…

The solution is to equip your agent with tools that allow it to fetch and process reliable data. For example, the agent could query search engines to gather verified, up-to-date information and then learn from that data to reduce hallucinations. The result would be more accurate decisions and greater confidence that the agent’s responses are based on real-world knowledge.

The easiest way to achieve that is through a SERP API or web search tool, such as Bright Data’s SERP API. This enterprise-grade API for search engine data retrieval handles proxies, unblocking, and data formatting for you. In other words, you do not have to worry about the typical challenges of gathering search engine data when working with AI agents.

Bright Data’s SERP API integrates directly with IBM watsonx Orchestrate (as well as many other AI agent-building platforms), allowing your AI agents to access search results and produce more contextual, trustworthy, and verifiable outputs.

Developing an AI Agent with SERP API Integration in IBM watsonx.ai: A Step-by-Step Guide

In this section, you will learn how to integrate the Bright Data SERP API as a tool within an AI agent in IBM watsonx Orchestrate.

Among the many possible use cases, this walkthrough focuses on building a content recommendation agent. Its goal is to suggest content ideas based on recent trends related to a given topic (e.g., discover the latest hot news worth writing about or making YouTube videos around for marketing).

Note: This is just one example, and you can adapt the same SERP API integration to power many other AI-driven use cases.

Follow the steps below!

Prerequisites

To follow along with this tutorial, make sure you have:

  • An IBMid for logging in to your IBM watsonx Orchestrate (a free trial is enough).
  • A Bright Data account with an active API key.

Do not worry about setting up your Bright Data account yet, as you will be walked through that process later on.

It is also helpful to have some familiarity with how the Bright Data SERP API works, how AI agents use tools, and the basics of OpenAPI specifications for defining tools.

Step #1: Create a New IBM watsonx AI Agent

Log in to IBM watsonx Orchestrate using your IBM account. You will reach this page:
Pressing the “Create new agent” button in IBM watsonx Orchestrate
Here, press the “Create new agent” button on the left to open the form for creating a new agent. Fill out the “Create an agent” form as follows:

  • Select the “Create from scratch” option.
  • Give your agent a name, such as “Content Recommendation Agent.”
  • Provide a description like: “This agent can retrieve up-to-date information from search engines via Bright Data’s SERP API integration to recommend relevant and interesting content based on a given input.”
    Filling out the “Create an agent” form
    Once done, press the “Create” button in the bottom left corner to continue. You will then access the agent management page:
    The “Content Recommendation Agent” page
    Great! You just initialized your content recommendation AI agent in IBM watsonx Orchestrate. This will soon be integrated with Bright Data’s SERP API for retrieving fresh search results.

Step #2: Customize your Agent

On the agent management page, you can customize several options, such as the agent’s voice, AI model, start prompts, hello message, and much more.

To change the model, open the dropdown on the right of the “AI model” section:
Selecting the available LLM
In the IBM watsonx trial version, you have access to the following two models:

  1. llama-3-2-90b-vision-instruct: Optimized for visual recognition, image reasoning, captioning, and answering questions about images. This is the default model.
  2. llama-3-405b-instruct: Advanced LLM for synthetic data generation, distillation, and inference for chatbots, coding, and domain-specific tasks. Developed by Meta.

Select the model that best fits your agent’s purpose.

Then, consider updating the welcome message to make it more contextual to your agent’s function. For example, write something like “What content recommendation tips do you want?”

Also, update the quick start prompts to provide example interactions for users:

  • “Recommend some recent movies I should definitely watch.”
  • “Show me the most recent news articles about IBM watsonx.”
  • “Find trending blog topics about AI in 2025 and suggest five content ideas I could write about.”

Now, since this agent will primarily rely on tools (specifically the Bright Data SERP API), it also makes sense to define it as a ReAct agent. If you are not familiar with this architecture, a ReAct agent follows this flow:

  • Thought: The LLM plans the next step.
  • Action: Executes actions using tools.
  • Observation: Observes results and refines the approach.

This continuous loop allows the agent to handle complex queries, cross-reference information, and validate intermediate results before providing a final answer.
Customizing the AI agent
Once all configurations are complete, go to the “Preview” section on the right and press the “Reset chat” button to reload your agent’s preview:
Pressing the “Reset chat” update button

You will now see the updated agent with all your customizations applied:
The updated AI agent

Step #3: Get Started With Bright Data’s SERP API

Before continuing with the AI agent definition, you need to prepare your Bright Data account and configure the SERP API service. To achieve that, either follow the official Bright Data documentation or the instructions below.

If you do not already have an account, create a Bright Data account. Otherwise, simply log in. Once logged in, navigate to the “Proxies & Scraping” page. In the “My Zones” section, look for a row labeled “SERP API” in the table:
Note the “serp_api” row in the table

If you do not see a row labeled “SERP API,” it means a zone has not been set up yet. Scroll down to the “SERP API” section and click “Create zone” to add one:
Configuring the SERP API zone
Create a SERP API zone and assign it a name, such as serp_api (or any name you prefer). Keep note of the zone name, as you will need it to access the service in IBM watsonx.

On the SERP API product page, switch the “Activate” toggle to enable the zone:
Activating the SERP API zone
Lastly, follow the official tutorial to generate your Bright Data API key. Store it in a safe place, as you will need it soon.

We also recommend checking out the Bright Data SERP API documentation to familiarize yourself with how to call the API, its available options, and other details.

Perfect! You now have everything set up to use Bright Data’s SERP API in your IBM watsonx AI agent.

Step #4: Add the SERP API Tool

As part of the customization options, you also have the ability to add tools to your agent. This is how you can connect an AI agent to Bright Data’s SERP API. Let’s go through the definition and integration of this custom tool (which will take the next three steps).

To add a new tool to your agent, go to the “Tools” section and click the “Add Tool” button:
Pressing the “Add Tool” button
Normally, you might consider selecting the “Create an agent workflow” option and writing the Python code to connect to the Bright Data SERP API. However, as of this writing, the available Python modules—you can import and use in custom Python code nodes—are fixed and cannot be extended. Since Python HTTP clients are not included, the custom code approach will not work. Instead, you can integrate the SERP API in a tool via an OpenAPI specification.

In detail, what you want to do is add the Bright Data API tool using an OpenAPI definition. To do that, create a file named bright-data-serp-api.yml on your local machine with the following specification:

openapi: 3.0.3
info:
  title: Bright Data SERP API
  version: 1.0.0
  description: >
    Bright Data SERP API provides real user results in high volumes for all the
    major search engines. Supports raw and Markdown output formats.
servers:
  - url: https://api.brightdata.com
paths:
  /request:
    post:
      summary: Send a SERP request
      description: >
        Submit a SERP scraping request using your Bright Data SERP API zone.
      tags:
        - SERP
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - zone
                - url
              properties:
                zone:
                  type: string
                  description: Your SERP API zone name.
                  default: <YOUR_BRIGHT_DATA_SERP_API_ZONE_NAME>
                url:
                  type: string
                  description: The search engine URL to query (e.g., https://www.google.com/search?q=<search_query>)
                  example: https://www.google.com/search?q=pizza&hl=en&gl=us
                format:
                  type: string
                  description: Response format
                  default: raw
                data_format:
                  type: string
                  description: Output data format
                  default: markdown
      responses:
        "200":
          description: Successful response with search results
          content:
            text/plain:
              schema:
                type: string
        "400":
          description: Invalid request
        "401":
          description: Unauthorized - invalid API key
        "500":
          description: Internal server error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY

Important: Replace <YOUR_BRIGHT_DATA_SERP_API_ZONE_NAME> with the actual name of your SERP API zone created earlier (e.g., serp_api).

The YAML code above defines an OpenAPI v3.0.3 specification for integrating the Bright Data SERP API. The key points to note are:

  • The API body defines the following parameters:
    • zone: The name of your SERP API zone.
    • url: The search engine page URL to query.
    • format: Specifies how the API should produce the output data. "``raw" means that the API will return the retrieved data directly in the response body, without nesting it in a structured object.
    • data_format: Determines the response format, such as HTML, parsed JSON, or Markdown. In this case, it is set to "markdown" by default, as that is an ideal data format for AI ingestion.
  • The bearerAuth section under securitySchemes indicates that the API connection is authenticated using a user-provided API key in the Authorization header via the Bearer mechanism (which is how you authenticate requests to the SERP API using your Bright Data API key).

What matters here is understanding that the above OpenAPI specification defines a Bright Data SERP API call that returns data in Markdown format. For all the above details, including the meaning of each parameter and option, check out the official documentation.

To pass that YAML file to IBM watsonx, in the “Add a new tool” modal, select “Add from file or MCP server”:
Selecting the “Add from file or MCP server” option

Then, choose “Import from file”:
Selecting the “Import from file” option

Tip: To simplify access to AI-ready Bright Data products, you could also select the “Import from MCP server” option and configure Bright Data’s Web MCP via its remote instance.

In the “Import tool” modal, either drag and drop your bright-data-serp-api.yml file or click to upload it:
Uploading your OpenAPI specification file

After validation completes, you should see the following confirmation message:
Note the validation message
Success! Your OpenAPI specification for Bright Data SERP API integration has been accepted. Press “Next” and continue with the tool integration in your agent.

Step #5: Complete the SERP API Tool Authentication

After pressing the “Next” button, you will see the “Send a SERP request” row in the “Operations” table:
Note the “Send a SERP request” row in the “Operations” table

Check it and then press the “Next” button. You will then reach the “Connections” section, where you need to define the connection required to authenticate SERP API requests using your Bright Data API key. Start by pressing the “Add new item” button:
Pressing the “Add new item” button

In the “Add new connection” section, give the connection an ID, such as bright-data-api-key:
Giving your connection an ID
Press “Save and continue” and configure your connection by selecting:

  • Authentication type: “Bearer Token”
  • Credentials type: “Team credentials”

Configuring the connection
In the “Bearer token” input field that appears after selecting the “Team credentials” option, paste your Bright Data API key. Then, press “Connect”:
Pressing the “Connect” button

Once the connection is verified, you should see a confirmation like this:
Note the “Connected” message

Next, press “Finish” and select bright-data-api-key in the “Connections” table:
Selecting the “bright-data-api-key” connection
Finally, complete the authentication configuration by pressing “Done”.

Congratulations! You have successfully authenticated your “Send a SERP request” custom tool for Bright Data SERP API integration.

Step #6: Finalize the SERP API Tool Configuration

In the agent’s management page, you will now see the “Send a SERP request” tool available in the “Toolset” section:
Note the “Send a SERP request” tool in the “Toolset” section

To further customize the tool, press the “⋮” button and select the “Edit Details” option. On the configuration page, review all settings to check that everything is correct and configured as needed:
Reviewing the “Send a SERP request” info
You will see the API description and request body parameters, along with their default values, as defined in the YAML specification uploaded earlier.

Here we go! You finally finished integrating Bright Data’s SERP API into your IBM watsonx agent using a custom tool defined via an OpenAPI specification.

Step #7: Test the Agent

Your IBM watsonx AI agent is now configured with access to a tool for SERP retrieval. Put it under test with a prompt that requires live search engine data, such as:

Find the most recent news about AI humanoid robots and suggest five content ideas I could write about to explore this topic.

(Note: This is just an example, and you can test any prompt that requires web search results.)

That is an ideal prompt because it requests current information that the foundation model alone may not know, as “AI humanoid robots” is a trending topic with constantly updated news.

Run this prompt in the “Preview” section of your agent, and you should see an output similar to this:
Running the prompt on the Content Recommendation Agent
The ReAct-based agent will call the “Send a SERP request” tool, retrieve the results, and process the SERP info to generate a coherent response.

If you have ever tried scraping Google search results, you know how challenging that is due to bot detection, IP bans, JavaScript rendering (which even led to a SERP data crisis), and other issues. The Bright Data SERP API handles all of this for you, returning scraped SERPs in AI-optimized Markdown (or HTML, JSON, etc.) format.

To make sure the SERP API was called by the agent, expand the “Reasoning” section of the response. Focus on “Step 1”:
Note the Markdown SERP
Notice how the first step corresponds to calling the Bright Data SERP API tool for the query “latest news AI humanoid robots” (which was inferred from the prompt). Then, the tool response is the Markdown version of the SERP page for that search query.

In this case, below is the response produced by the AI agent:

Based on the search results, here are five content ideas to explore the topic of AI humanoid robots:
1. "The Future of Work: How AI Humanoid Robots are Revolutionizing Industries" - This article could explore the various ways in which AI humanoid robots are being used in different industries, such as manufacturing, healthcare, and customer service.
2. "The Ethics of AI Humanoid Robots: Should They be Given Human Rights?" - This article could delve into the ethical implications of creating robots that are increasingly human-like, and whether they should be granted human rights.
3. "The Latest Advances in AI Humanoid Robots: What You Need to Know" - This article could provide an overview of the latest developments in AI humanoid robots, including new technologies and innovations that are being used to create more advanced robots.
4. "The Potential Risks and Benefits of AI Humanoid Robots in the Home" - This article could explore the potential risks and benefits of having AI humanoid robots in the home, including their potential to assist with household chores and provide companionship.
5. "The Impact of AI Humanoid Robots on Society: A Look at the Future" - This article could examine the potential impact of AI humanoid robots on society, including their potential to change the way we live and work, and the potential consequences of creating robots that are increasingly human-like.

This is a great response with valuable insights for content generation!

Now it is time to take your agent even further. Try testing prompts related to fact-checking, brand monitoring, market trend analysis, or other scenarios to evaluate how it performs across different RAG and agentic use cases.

Et voilà! You just built an AI agent in IBM watsonx integrated with Bright Data’s SERP API. Your agent can now retrieve up-to-date, reliable, and contextual web search data on demand to power intelligent content recommendations.

Conclusion

In this blog post, you understood how to integrate Bright Data’s SERP API into an IBM watsonx AI agent using a low-code workflow.

This approach is ideal for business users looking to build context-aware AI agents on IBM while leveraging the scalable and enterprise-ready features of Bright Data’s SERP API. To take your AI workflows even further, explore Bright Data’s infrastructure for AI.

Sign up for Bright Data today and start testing our AI-ready web data solutions for free!

Antonello Zanini

Technical Writer

5.5 years experience

Antonello Zanini is a technical writer, editor, and software engineer with 5M+ views. Expert in technical content strategy, web development, and project management.

Expertise
Web Development Web Scraping AI Integration