Skip to content

feat!: remove the Discover API surface - #51

Open
nirsha-brd wants to merge 1 commit into
brightdata:mainfrom
nirsha-brd:remove-discover-api
Open

feat!: remove the Discover API surface#51
nirsha-brd wants to merge 1 commit into
brightdata:mainfrom
nirsha-brd:remove-discover-api

Conversation

@nirsha-brd

Copy link
Copy Markdown

Removes the Bright Data Discover API integration (POST/GET https://api.brightdata.com/discover).

Changes

File Change
src/brightdata/discover/ deleted (__init__.py, models.py, service.py)
notebooks/07_discover_api.ipynb deleted
src/brightdata/client.py removed the imports, the _discover_service field, and discover() / discover_trigger()
src/brightdata/sync_client.py removed the import and all six sync verbs — discover, discover_trigger, discover_status, discover_wait, discover_fetch, discover_to_result — plus the _discover_service helper
src/brightdata/__init__.py removed the import and the DiscoverResult / DiscoverJob / DiscoverSnapshot __all__ entries
src/brightdata/models.py removed the trailing comment pointing at discover/models.py
tests/unit/test_colorless_service_verbs.py removed TestDiscoverServiceVerbs and the imports it orphaned
tests/unit/test_sync_client_coverage.py removed TestDiscoverSyncPath and the DiscoverSnapshot import
README.md removed the ### Discover API section
CHANGELOG.md / pyproject.toml 2.5.1 → 3.0.0

The trap worth flagging in review

"discover" means two different products in this repo. 204 files match the string. All but a handful belong to the dataset discovery feature, which this PR does not touch:

  • discover_by / discover_new dataset triggers
  • discover_by_category (DigiKey, and its sync wrappers)
  • InstagramPostsDiscoverPayload / InstagramReelsDiscoverPayload
  • the client.search.* scrapers
  • 305 files under src/brightdata/datasets/ — I checked every one; their only match is the English verb in docstrings like "Use get_metadata() to discover all available fields"

I classified each reference before deleting anything. tests/unit/test_x_scraper.py::test_forwarded_on_discover_trigger is likewise unrelated — it is a test name, and its body calls posts_by_profile_trigger.

Verification

Baseline captured on pristine main before any edit, then re-run on this branch.

Check Pristine main This branch
pytest 321 passed, 0 failed 313 passed, 0 failed
ruff check . 1 error 1 error (same one)
black --check . pass pass — 391 files unchanged

The suite is fully green before and after. The delta of 8 is exactly the removed Discover tests: 5 from TestDiscoverServiceVerbs and 3 from TestDiscoverSyncPath. No test that existed before fails now.

The single ruff error is setup.py:8:1: I001 Import block is un-sorted or un-formatted — pre-existing and identical on untouched main, in a file this PR never opens.

Import smoke test on the built package:

import brightdata                        -> OK
BrightDataClient.discover                -> gone
SyncBrightDataClient.discover            -> gone
SyncBrightDataClient.discover_fetch      -> gone
brightdata.DiscoverResult                -> gone

Python resolves imports at module load, so a dangling reference to the deleted package would surface immediately on import brightdata. It does not.

Migration

Use client.search.google() / bing() / yandex() to find sources and client.scrape_url() to read them.

Version

3.0.0, matching this changelog's precedent — ## Version 2.0.0 carried a ### 🚨 Breaking Changes section for a change of this class. Removing eight public methods and three exported models is breaking.

Out of scope

brightdata/skills still ships a discover-api skill, and its python-sdk-best-practices, live-research and rag-pipeline skills reference client.discover. Those need a follow-up PR.

Removes the Bright Data Discover API integration
(POST/GET https://api.brightdata.com/discover).

Deletes the brightdata.discover package and notebooks/07_discover_api.ipynb;
removes BrightDataClient.discover() / discover_trigger(); removes the six
SyncBrightDataClient verbs (discover, discover_trigger, discover_status,
discover_wait, discover_fetch, discover_to_result) and the _discover_service
helper; drops the DiscoverResult / DiscoverJob / DiscoverSnapshot exports from
brightdata.__init__; and removes the Discover test classes from
test_colorless_service_verbs.py and test_sync_client_coverage.py along with
the imports they orphaned.

The dataset discovery feature is a DIFFERENT product and is untouched:
discover_by / discover_new dataset triggers, discover_by_category,
InstagramPostsDiscoverPayload / InstagramReelsDiscoverPayload, and the
search.* scrapers all remain.

BREAKING CHANGE: client.discover(), client.discover_trigger() and the sync
discover_* verbs are removed, along with the DiscoverResult, DiscoverJob and
DiscoverSnapshot exports.
@nirsha-brd
nirsha-brd marked this pull request as ready for review August 12, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant