agentsclimarketplace

Brightdata hello world

Skill jeremylongshore/claude-code-plugins-plus-skills/skills/.curated/brightdata-hello-world

'Create a minimal working Bright Data example.From its SKILL.md

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill brightdata-hello-world

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.1 KB, 902 tokens by cl100k_base, as published. Nobody here has run it

Bright Data Hello World

Overview

Scrape a real webpage through Bright Data's Web Unlocker proxy. Web Unlocker handles CAPTCHAs, fingerprinting, and retries automatically — you send a normal HTTP request through the proxy endpoint at brd.superproxy.io:33335.

Prerequisites

  • Completed brightdata-install-auth setup
  • Web Unlocker zone active in Bright Data control panel
  • brd-ca.crt SSL certificate downloaded

Instructions

Step 1: Scrape via Web Unlocker Proxy (Node.js)

// hello-brightdata.ts
import axios from 'axios';
import https from 'https';
import 'dotenv/config';

const { BRIGHTDATA_CUSTOMER_ID, BRIGHTDATA_ZONE, BRIGHTDATA_ZONE_PASSWORD } = process.env;

const proxy = {
  host: 'brd.superproxy.io',
  port: 33335,
  auth: {
    username: `brd-customer-${BRIGHTDATA_CUSTOMER_ID}-zone-${BRIGHTDATA_ZONE}`,
    password: BRIGHTDATA_ZONE_PASSWORD!,
  },
};

async function scrape(url: string) {
  const response = await axios.get(url, {
    proxy,
    httpsAgent: new https.Agent({ rejectUnauthorized: false }),
    timeout: 60000,
  });
  console.log(`Status: ${response.status}`);
  console.log(`Content length: ${response.data.length} chars`);
  console.log(response.data.substring(0, 500));
  return response.data;
}

scrape('https://example.com').catch(console.error);

Step 2: Scrape via REST API

// hello-brightdata-api.ts
import 'dotenv/config';

async function scrapeViaAPI(url: string) {
  const response = await fetch('https://api.brightdata.com/request', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.BRIGHTDATA_API_TOKEN}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      zone: process.env.BRIGHTDATA_ZONE,
      url,
      format: 'raw',
    }),
  });
  const html = await response.text();
  console.log(`Status: ${response.status}, Length: ${html.length}`);
  return html;
}

scrapeViaAPI('https://example.com').catch(console.error);

Step 3: Python Version

# hello_brightdata.py
import os, requests
from dotenv import load_dotenv

load_dotenv()
proxy_url = (
    f"http://brd-customer-{os.environ['BRIGHTDATA_CUSTOMER_ID']}"
    f"-zone-{os.environ['BRIGHTDATA_ZONE']}"
    f":{os.environ['BRIGHTDATA_ZONE_PASSWORD']}"
    f"@brd.superproxy.io:33335"
)
response = requests.get(
    'https://example.com',
    proxies={'http': proxy_url, 'https': proxy_url},
    verify='./brd-ca.crt',
    timeout=60,
)
print(f"Status: {response.status_code}, Length: {len(response.text)}")

Geo-Targeting

Add country or city targeting to the proxy username:

// Country-level
const username = `brd-customer-${ID}-zone-${ZONE}-country-us`;
// City-level
const username2 = `brd-customer-${ID}-zone-${ZONE}-country-us-city-newyork`;

Output

  • Successful HTTP response through Bright Data proxy
  • HTML content of the target page
  • Rotated IP address per request

Error Handling

ErrorCauseSolution
407 Proxy Auth RequiredBad credentialsCheck brd-customer-{ID}-zone-{ZONE} format
502 Bad GatewayTarget site blockedWeb Unlocker retries; increase timeout
ETIMEDOUTCAPTCHA solving delaySet timeout to 60-120s
Empty responseZone inactiveVerify zone in control panel

Resources

Next Steps

Proceed to brightdata-local-dev-loop for development workflow setup.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.