Title: List input pairs results with URLs by position, so a result carries another input's data; every result is success=True · Issue #60 · brightdata/sdk-python · GitHub
Open Graph Title: List input pairs results with URLs by position, so a result carries another input's data; every result is success=True · Issue #60 · brightdata/sdk-python
X Title: List input pairs results with URLs by position, so a result carries another input's data; every result is success=True · Issue #60 · brightdata/sdk-python
Description: Summary When a scraper method is given a list of URLs, the SDK pairs the returned rows with the input URLs by position. The API does not return rows in input order, so each ScrapeResult can carry one input's url and a different input's d...
Open Graph Description: Summary When a scraper method is given a list of URLs, the SDK pairs the returned rows with the input URLs by position. The API does not return rows in input order, so each ScrapeResult can carry o...
X Description: Summary When a scraper method is given a list of URLs, the SDK pairs the returned rows with the input URLs by position. The API does not return rows in input order, so each ScrapeResult can carry o...
Opengraph URL: https://github.com/brightdata/sdk-python/issues/60
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"List input pairs results with URLs by position, so a result carries another input's data; every result is success=True","articleBody":"### Summary\n\nWhen a scraper method is given a list of URLs, the SDK pairs the returned rows with the input URLs **by position**. The API does not return rows in input order, so each `ScrapeResult` can carry one input's `url` and a different input's `data`. Every result is also marked `success=True`, including error rows.\n\nOn LinkedIn this attaches one person's profile to a different identity. The dataset marks those fields as personal data (`pii: true`), so this is a data-integrity problem, not only a wrong-label one.\n\nThe same code is in six scrapers: amazon (2 places), facebook (2), instagram, linkedin, pinterest, tiktok.\n\n### Environment\n\n- `brightdata-sdk` 2.5.2 (latest on PyPI)\n- Python 3.12.13, macOS\n- Verified 18 Sep 2026\n\n### Reproduction\n\n```python\nfrom brightdata import SyncBrightDataClient\n\nurls = [\n \"https://www.linkedin.com/in/reidhoffman/\",\n \"https://www.linkedin.com/in/zz-not-a-real-profile-zz/\",\n \"https://www.linkedin.com/in/satyanadella/\",\n]\nwith SyncBrightDataClient(auto_create_zones=False) as c:\n results = c.scrape.linkedin.profiles(urls, timeout=420)\n\nfor r in results:\n d = r.data if isinstance(r.data, dict) else {}\n print(r.url, \"| success\", r.success, \"| name\", d.get(\"name\"), \"| error\", d.get(\"error\"))\n```\n\n```\nhttps://www.linkedin.com/in/reidhoffman/ | success True | name None | error The profile is hidden or private.\nhttps://www.linkedin.com/in/zz-not-a-real-profile-zz/ | success True | name Reid Hoffman | error None\nhttps://www.linkedin.com/in/satyanadella/ | success True | name Satya Nadella | error None\n```\n\n- The result labelled `reidhoffman` holds the dead profile's error, so a caller concludes Reid Hoffman's profile is hidden or private. It is not.\n- The result labelled `zz-not-a-real-profile-zz`, an account that does not exist, holds Reid Hoffman's real profile.\n- All three are `success=True`.\n\n### The API returns a different order each run\n\nFetching the raw snapshot for the same three inputs, in a second job:\n\n```\nraw[0] reidhoffman\nraw[1] satyanadella\nraw[2] zz-not-a-real-profile-zz (error row)\n```\n\nThe first job returned the error row first. The order is not stable, so there is no input ordering a caller could choose to avoid this.\n\n### Why it happens\n\n`scrapers/linkedin/scraper.py`, `_scrape_urls`:\n\n```python\nresults = []\nfor url_item, data_item in zip(url_list, result.data):\n results.append(\n ScrapeResult(\n success=True,\n data=data_item,\n url=url_item,\n ...\n```\n\n`zip` pairs the n-th input with the n-th row. `success=True` is a literal.\n\n### Every row already says which input it belongs to\n\n```\nsuccess row: input_url = \"https://www.linkedin.com/in/reidhoffman/\"\nerror row: input = {\"url\": \"https://www.linkedin.com/in/zz-not-a-real-profile-zz/\"}\nerror row keys: [\"error\", \"error_code\", \"input\", \"timestamp\"]\n```\n\nSo correct pairing needs no guesswork: match each row on `input_url`, falling back to `input.url`.\n\n### Other shapes of the same bug\n\n- If the API returns fewer rows than inputs, `zip` stops at the shorter list and those inputs get no result at all, with nothing to say one is missing.\n- When the job fails or times out, `result.data` is not a list, so the method returns one `ScrapeResult` instead of a list. A caller iterating the list-input return gets a single object.\n\n### Affected\n\n`grep -c \"zip(url_list, result.data)\"` across `scrapers/*/scraper.py`:\n\n| scraper | occurrences |\n| --- | --- |\n| amazon | 2 |\n| facebook | 2 |\n| instagram | 1 |\n| linkedin | 1 |\n| pinterest | 1 |\n| tiktok | 1 |\n\n### Expected\n\n1. Pair each row with its input by `input_url` / `input.url`, not by position.\n2. Set `success` from the row: `False` when the row has an `error` key.\n3. Return one result per input even when a row is missing, with `success=False`, rather than dropping it.\n4. Return a list for list input on every path, including failure and timeout.\n\n### Workaround\n\nIgnore `ScrapeResult.url` on list input. Flatten every `result.data` and match rows to inputs on `input_url` or `input.url` yourself.\n","author":{"url":"https://github.com/anil-bd","@type":"Person","name":"anil-bd"},"datePublished":"2026-09-18T13:42:48Z","url":"https://github.com/brightdata/sdk-python/issues/60"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2deaf2ec-c4be-c974-a72a-4f48a4ac5f11 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D312:1C9CD4:128A2:1883C:6B0429BF |
| html-safe-nonce | 76edc8ecec25d582a378ef5f2a0af465245666dfef7c8cf73c88ea08f1a53705 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzEyOjFDOUNENDoxMjhBMjoxODgzQzo2QjA0MjlCRiIsInZpc2l0b3JfaWQiOiI5ODYxNzYyMjE1NDMxNDc5NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b28f4059f409c4a01181ffb25a80752875859b138974954f034216f67ddc3670 |
| hovercard-subject-tag | issue:5500274992 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/brightdata/sdk-python/60/issue_layout |
| twitter:image | https://opengraph.githubassets.com/09fa0317ba052aa69ccc9319a47e23fff21dae1a5e22e71331b3ef775ff32e92/brightdata/sdk-python/issues/60 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/09fa0317ba052aa69ccc9319a47e23fff21dae1a5e22e71331b3ef775ff32e92/brightdata/sdk-python/issues/60 |
| og:image:alt | Summary When a scraper method is given a list of URLs, the SDK pairs the returned rows with the input URLs by position. The API does not return rows in input order, so each ScrapeResult can carry o... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anil-bd |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/brightdata/sdk-python git https://github.com/brightdata/sdk-python.git |
| octolytics-dimension-user_id | 213028976 |
| octolytics-dimension-user_login | brightdata |
| octolytics-dimension-repository_id | 1033685757 |
| octolytics-dimension-repository_nwo | brightdata/sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1033685757 |
| octolytics-dimension-repository_network_root_nwo | brightdata/sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width