Skip to main content

Building an AI startup?

You might be eligible for our Startup Program. Get fully funded access to the infrastructure you’re reading about right now (up to $20K value).

Why Use Bright Data With Smolagents?

The Bright Data tools for Smolagents provide the following capabilities:
  • search_tool
    Search Google and get structured search results. This tool can search the web and return relevant results for your queries.
  • extract_tool
    Scrape webpages and extract content as Markdown format. This tool can bypass CAPTCHA and bot detection to reliably extract data from any website.
  • data_feeds_tool
    Retrieve structured data from various platforms including LinkedIn, Amazon, Instagram, Facebook, X (Twitter), Zillow, and more.
Supported platforms include:
  • LinkedIn (profiles and companies)
  • Amazon (products and reviews)
  • Instagram (profiles, posts, reels, comments)
  • Facebook (posts, marketplace listings, company reviews)
  • X/Twitter (posts)
  • Zillow (property listings)
  • Booking.com (hotel listings)
  • YouTube (videos)
  • And many more
For more information, visit the Bright Data documentation.

How to Integrate Bright Data With Smolagents?

1

Obtain Your Bright Data API Key

2

Installation

Install the required packages. Important: As of December 9, 2025, these specific versions are mandatory to align with Smolagents:
3

Configure API Key

Set your Bright Data API key as an environment variable:
Or set it in your Python code:
4

Obtain Your Hugging Face API Token

When using InferenceClientModel, you need a Hugging Face token for authentication:
  • Visit Hugging Face Settings - Tokens
  • Create a new token with “Make calls to the serverless Inference API” permission
  • Set it as an environment variable:
Or pass it directly when initializing the model:
Note: Free Hugging Face accounts include inference credits. Upgrade to PRO for higher rate limits.
5

Usage

Here’s a complete example of how to use Bright Data tools with Smolagents:

Example Use Cases

Use the search tool to find information across the web:
Scrape and extract content from websites:
Extract structured data from e-commerce platforms:
Retrieve data from social media platforms:

Tips for Best Results

  • Be specific with your prompts to help the agent understand exactly what data you need
  • Combine tools for complex tasks - the agent can use search, extract, and data feeds together
For more advanced configurations and detailed API documentation, visit Bright Data’s documentation.