Skip to main content

An unofficial Python client for Bright Data APIs.

Project description

BDClient

An unofficial Python client for Bright Data APIs.

Features:

  • Scraper API
    • Google News
    • Google SERP
    • YouTube Videos
  • SERP API
    • Google Search
  • Unlocker API

Installation

Installing using pip:

pip install bdclient

Installing using uv:

uv add bdclient

Usage

Example Scraper API usage:

import asyncio

from bdclient.scraper.youtube_videos import DiscoverByKeyword, DiscoverByKeywordQuery


async def main():
    scraper = DiscoverByKeyword(api_key="your_bright_data_api_key")
    query = DiscoverByKeywordQuery(keyword="How to make pizza")

    results = await scraper.scrape([query])
    for result in results:
        print(result.model_dump_json(indent=4))


if __name__ == "__main__":
    asyncio.run(main())

Example SERP API usage:

import asyncio

from bdclient.serp.google_search import GoogleSearch


async def main():
    google_search = GoogleSearch(
        api_key="your_bright_data_api_key",
        zone="your_serp_zone",
    )
    result = await google_search.search(keyword="Pizza toppings")
    print(result)


if __name__ == "__main__":
    asyncio.run(main())

Example Unlocker API usage:

import asyncio

from bdclient.unlocker import Unlocker


async def main():
    unlocker = Unlocker(
        api_key="your_bright_data_api_key",
        zone="your_unlocker_zone",
    )

    result = await unlocker.unlock("https://www.bbc.com/news/articles/c8ex2l58en4o")
    print(result)


if __name__ == "__main__":
    asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bdclient-0.4.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bdclient-0.4.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file bdclient-0.4.0.tar.gz.

File metadata

  • Download URL: bdclient-0.4.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.1

File hashes

Hashes for bdclient-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5a147d7efba018e09c09cddd8d48bbf42f4d3c33a8c69b66abfa52e2e642271a
MD5 dd7c46f9b80d473163c31628fa43e2c6
BLAKE2b-256 6d1b683dce009abc2a123fd0d950cfc15f21c5274b39727a83cb590cbaa8cf9f

See more details on using hashes here.

File details

Details for the file bdclient-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: bdclient-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.1

File hashes

Hashes for bdclient-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5273f32d3ee43d46cd5dd2606e8c81bf3ce675afe7a6a348d8341297222680e
MD5 9131afcced8518146da3914a0e3f0ba4
BLAKE2b-256 45d27adb1ef5aec61932c8643c0b215ee12daefe1d82ba46c498c0cc06344dfc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page