Skip to content

Instagram posts discovery: docstring says post_type="Reel", the API wants "Reels"; "Reel" returns an error row and no reels #59

Description

@anil-bd

SDK: brightdata-sdk 2.5.2 (latest on PyPI), Python 3.12. Instagram posts discovery, client.search.instagram.posts(...).

Summary

The docstring of search.instagram.posts says post_type: Filter by type - "Post" or "Reel" (brightdata/scrapers/instagram/search.py). The API accepts "Reels", plural. "Reel" is passed through unchanged and the job returns one error row, Unable to discover older posts, with no data, even when reels exist in the window.

Steps to reproduce

pip install brightdata-sdk==2.5.2
export BRIGHTDATA_API_TOKEN=YOUR_API_KEY
python - <<'PY'
from brightdata import SyncBrightDataClient

URL = "https://www.instagram.com/nasa/"
with SyncBrightDataClient(auto_create_zones=False) as client:
    for post_type in ("Reel", "reel", "Reels", "Post"):
        r = client.search.instagram.posts(
            URL, num_of_posts=3, start_date="08-01-2026", end_date="09-07-2026", post_type=post_type
        )
        rows = r.data if isinstance(r.data, list) else [r.data]
        print(f'post_type="{post_type}": success={r.success} rows={len(rows)}')
        for row in rows:
            print("   ", row.get("content_type"), row.get("date_posted"), row.get("url"), "| error:", row.get("error"))
PY

Actual (2026-09-08)

post_type="Reel": success=True rows=1
    None None None | error: Unable to discover older posts
post_type="reel": success=True rows=1
    None None None | error: Unable to discover older posts
post_type="Reels": success=True rows=3
    Reel 2026-08-18T19:37:40.000Z https://www.instagram.com/reel/DcMXl1IPNtB/ | error: None
    Reel 2026-09-04T17:31:24.000Z https://www.instagram.com/reel/Dc37MPNSAZq/ | error: None
    Reel 2026-09-05T01:00:10.000Z https://www.instagram.com/reel/Dc4u1yKPj_s/ | error: None
post_type="Post": success=True rows=3
    Carousel 2026-09-04T16:19:24.000Z https://www.instagram.com/p/Dc3zNGWlIpy/ | error: None
    Image 2026-08-19T14:11:47.000Z https://www.instagram.com/p/DcOX3hWFiey/ | error: None
    Image 2026-08-12T21:28:58.000Z https://www.instagram.com/p/Db9IVmrDvQ4/ | error: None

On 2026-09-07 the "Reel" call returned zero rows and no error row at all, so the failure mode also varies.

Expected

Either of these, ideally both:

  1. The docstring and examples say "Post" or "Reels", the values the API actually accepts.
  2. The SDK validates post_type and raises a ValidationError naming the accepted values, instead of forwarding a value that produces an error row whose message ("Unable to discover older posts") points nowhere near the cause.

Where

brightdata/scrapers/instagram/search.py: the docstring at the post_type parameter, and the two lines that copy post_type into the payload item without checking it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions