What you’ll build
A GitHub repository containing:- A
skus.jsonfile listing the Amazon product URLs to monitor - A Python script that POSTs the SKU list to the Bright Data Amazon Scraper API
- A GitHub Actions workflow that runs the script on a daily schedule
- Bright Data configured to deliver each snapshot to your S3 bucket
Prerequisites
- A Bright Data account with an API key (get your key)
- An S3 bucket with Bright Data delivery already configured. Follow Amazon to S3 delivery once, then come back. This tutorial assumes the delivery destination is already saved in your Amazon scraper’s settings.
- A GitHub account and a new (empty) repository
- Python 3.9+ installed locally
- Git installed locally
Part 1: Create the SKU list
Clone your empty GitHub repo locally and create askus.json file at the repo root:
skus.json
Part 2: Write the trigger script
Createtrigger_scrape.py at the repo root:
trigger_scrape.py
requirements.txt:
- The script does not wait for results. It fires the trigger and exits. Bright Data runs the scrape asynchronously and delivers the results directly to S3 via the delivery config you saved in your scraper settings. That’s the whole point: the script is a cheap, stateless trigger.
- The API key comes from an environment variable. Never commit keys to a repo. We’ll wire this to GitHub Actions Secrets in Part 4.
Part 3: Run it locally
Install the dependency and run the script with your key:The price field is
final_price, and it can be null for products that are out of stock or currency-ambiguous listings. Your BI pipeline should handle that case explicitly rather than crashing on a missing key.snapshot_id, not by date. That’s deliberate: each snapshot is immutable, and you can walk the bucket chronologically by listing creation timestamps or by enabling versioning. We’ll discuss naming conventions in “Next steps.”
Part 4: Schedule the workflow on GitHub Actions
Now let’s move the trigger off your laptop and onto a daily schedule. Create.github/workflows/daily-scrape.yml:
.github/workflows/daily-scrape.yml
schedule: cron: "0 6 * * *"runs the job at 06:00 UTC every day. Adjust the cron expression for your timezone. GitHub does not guarantee the start time of a scheduled workflow. GitHub’s events that trigger workflows reference says a scheduled run “can be delayed during periods of high loads,” and high load includes the start of every hour.workflow_dispatchadds a Run workflow button in the Actions tab so you can kick off the job on demand without waiting for the schedule.
- In your GitHub repo, go to Settings > Secrets and variables > Actions
- Click New repository secret
- Name it
BRIGHTDATA_API_KEYand paste your key - Click Add secret
Part 5: Push and verify
Commit everything and push:Troubleshooting
Why is there no file in S3 after 2 minutes?
Check the job status before you check the bucket. Send thesnapshot_id that trigger_scrape.py printed in Part 3 to Monitor progress (GET /datasets/v3/progress/{snapshot_id}) and read the status field:
startingorrunning: the Amazon Scraper API is still collecting. Wait and check again.ready: the scrape finished, so the problem is in delivery. Check the S3 destination saved in the Amazon scraper’s delivery settings and the bucket permissions. The IAM role must allows3:PutObjecton the bucket. See Files not appearing in S3? in the delivery guide.
Why does the trigger script fail with a 401?
The Bright Data API rejected the API key. A 401 withInvalid credentials means the key value is wrong. Locally, check the value you exported as BRIGHTDATA_API_KEY. In GitHub Actions, check the repository secret under Settings > Secrets and variables > Actions. The secret name must be exactly BRIGHTDATA_API_KEY. When the secret is missing, the script prints BRIGHTDATA_API_KEY environment variable is not set. instead of a 401.
Why is final_price null?
The Amazon Scraper API returns final_price as null for products that are out of stock and for currency-ambiguous listings. Check the availability field in the same record. Handle null in your BI pipeline instead of treating it as an error.
Why didn’t the scheduled workflow run?
GitHub runs scheduled workflows in UTC by default, so0 6 * * * fires at 06:00 UTC, not 06:00 in your timezone. The GitHub Actions schedule event reference also lists these limits:
- A scheduled run can be delayed during high load, which includes the start of every hour. If the load is high enough, GitHub may drop queued jobs. GitHub suggests scheduling at a different minute of the hour, for example
17 6 * * * - Scheduled workflows run only from the workflow file on the default branch
- In a public repository, GitHub disables scheduled workflows after 60 days with no repository activity
Congratulations
You’ve built a fully automated daily price monitor:- A SKU list version-controlled in GitHub
- A Python trigger script that fires the Bright Data scrape and exits
- A GitHub Actions workflow that runs on a daily cron and authenticates via a repo secret
- Bright Data S3 delivery that drops each snapshot into your bucket asynchronously
Next steps
Stream large snapshots
Use
stream_max_lines to start receiving batches as soon as the first records are ready.Amazon async reference
Full parameter list for the async trigger endpoint, including
include_errors and limit_per_input.Monitor delivery status
Programmatically check snapshot status and delivery result from inside the workflow.
Deliver results
Swap S3 for GCS, Azure, Snowflake or SFTP with the same trigger call.