npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@brightdata/ai-sdk

v0.1.0

Published

Bright Data tools for Vercel AI SDK - scrape, search, and dataset collection

Readme

@brightdata/ai-sdk

Give your AI agent eyes on the web.

Plug-and-play Vercel AI SDK tools powered by Bright Data - scrape any site, search any engine, and collect structured data from Amazon, LinkedIn, Instagram, Facebook, and more.

npm version License: MIT


Why?

LLMs are powerful reasoners, but they can't see the live web. This package bridges that gap — each export is a ready-made tool() that any AI SDK-compatible model can call autonomously:

  • Scrape — fetch any webpage as clean markdown, bypassing anti-bot protection
  • Search — query Google, Bing, or Yandex and get structured results
  • Datasets — pull product details, job listings, social profiles, and more

No browser automation. No proxy configuration. Just import, configure, and let the model decide when to use each tool.


Quick Start

1. Install

npm install @brightdata/ai-sdk ai zod

2. Get your API key

Sign up at brightdata.com and grab your API key from the dashboard.

Set it as an environment variable, or place it in .env at your project root:

BRIGHTDATA_API_KEY="your_api_key"

If you prefer shell exports:

export BRIGHTDATA_API_KEY="your_api_key"

3. Run your first agent

import { anthropic } from '@ai-sdk/anthropic';
import { generateText, stepCountIs } from 'ai';
import { scrape, search } from '@brightdata/ai-sdk';

const { text } = await generateText({
    model: anthropic('claude-sonnet-4-5-20250929'),
    tools: {
        scrape: scrape(),
        search: search(),
    },
    stopWhen: stepCountIs(5),
    prompt: 'Find and summarize the top 3 trending AI papers this week.',
});

console.log(text);

The model will autonomously decide when to search the web and when to scrape specific pages.


Available Tools

| Tool | Description | Key Inputs | |---|---|---| | scrape | Scrape any URL to clean markdown or HTML | url, country | | search | Search Google, Bing, or Yandex | query, search_engine, country | | amazon_product | Get Amazon product details, pricing, and reviews | url, zipcode | | linkedin_profile | Collect LinkedIn profile data | urls (array) | | linkedin_jobs | Discover LinkedIn job postings | location, keyword, country | | instagram_profile | Fetch Instagram profile info and posts | url | | facebook_profile | Collect Facebook profile data | url | | chatgpt | Collect ChatGPT responses with optional web search | prompt, web_search |


Usage Examples

Web Research Agent

Combine scrape and search to build an agent that can research any topic:

import { openai } from '@ai-sdk/openai';
import { generateText, stepCountIs } from 'ai';
import { scrape, search, amazon_product } from '@brightdata/ai-sdk';

const { text } = await generateText({
    model: openai('gpt-4o'),
    tools: {
        scrape: scrape(),
        search: search(),
        amazon_product: amazon_product(),
    },
    stopWhen: stepCountIs(10),
    prompt: 'Search for the best noise-cancelling headphones and compare'
        + ' prices on Amazon',
});

Streaming with Next.js App Router

// app/api/research/route.ts
import { anthropic } from '@ai-sdk/anthropic';
import { streamText, stepCountIs } from 'ai';
import { scrape, search } from '@brightdata/ai-sdk';

export async function POST(req: Request) {
    const { prompt } = await req.json();

    const result = streamText({
        model: anthropic('claude-sonnet-4-5-20250929'),
        tools: {
            scrape: scrape(),
            search: search(),
        },
        stopWhen: stepCountIs(5),
        prompt,
    });

    return result.toDataStreamResponse();
}

LinkedIn Job Discovery

import { generateText, stepCountIs } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { linkedin_jobs, linkedin_profile } from '@brightdata/ai-sdk';

const { text } = await generateText({
    model: anthropic('claude-sonnet-4-5-20250929'),
    tools: {
        linkedin_jobs: linkedin_jobs(),
        linkedin_profile: linkedin_profile(),
    },
    stopWhen: stepCountIs(5),
    prompt: 'Find senior software engineer jobs in San Francisco'
        + ' and show me the profiles of people in similar roles.',
});

Social Media Intelligence

import { generateText, stepCountIs } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { instagram_profile, facebook_profile } from '@brightdata/ai-sdk';

const { text } = await generateText({
    model: anthropic('claude-sonnet-4-5-20250929'),
    tools: {
        instagram: instagram_profile(),
        facebook: facebook_profile(),
    },
    stopWhen: stepCountIs(5),
    prompt: 'Analyze the social media presence for @natgeo on Instagram.',
});

Cherry-Picking Individual Tools

You don't have to use all tools at once — import only what you need:

import { scrape } from '@brightdata/ai-sdk';

const scrape_tool = scrape({
    api_key: 'your_api_key',
    data_format: 'html',
    country: 'us',
});

Configuration

Every tool factory accepts an options object. Common options:

| Option | Type | Description | |---|---|---| | api_key | string | Bright Data API key. Falls back to BRIGHTDATA_API_KEY from process env or .env file. | | data_format | string | Output format ('markdown', 'html'). Varies by tool. | | country | string | Two-letter country code for geo-targeted requests. |

Tool-Specific Options

search() also accepts:

  • search_engine'google' | 'bing' | 'yandex' (default: 'google')

linkedin_profile() and facebook_profile() also accept:

  • format'json' | 'jsonl'

chatgpt() also accepts:

  • format'json' | 'jsonl'

Requirements


Related


License

MIT - Bright Data