-
Notifications
You must be signed in to change notification settings - Fork 0
[SCR-434] introduce amazon pricing #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
marius-nemeiksis-sbee
wants to merge
6
commits into
main
Choose a base branch
from
SCR-434-introduce-amazon-pricing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0765318
add amazon-pricing to cli
marius-nemeiksis-sbee dd5b031
add all autogenerated files
marius-nemeiksis-sbee d565afd
Update CHANGELOG.md
marius-nemeiksis-sbee a064b15
bump version
marius-nemeiksis-sbee 02c1da0
[SCR-377] new params to google shopping (#22)
marius-nemeiksis-sbee 66e245b
linting
marius-nemeiksis-sbee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
.agents/skills/scrapingbee-cli/reference/amazon/pricing.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Amazon Pricing API | ||
|
|
||
| > **Syntax:** use space-separated values — `--option value`, not `--option=value`. | ||
|
|
||
| Fetch pricing details for a single product by **ASIN**. JSON output. **Credit:** 5–15 per request. Use **`--output-file file.json`** (before or after command). | ||
|
|
||
| ## Command | ||
|
|
||
| ```bash | ||
| scrapingbee amazon-pricing --output-file pricing.json B0DPDRNSXV --domain com | ||
| ``` | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Description | | ||
| |-----------|------|-------------| | ||
| | `--device` | string | `desktop` (only supported value). | | ||
| | `--domain` | string | Amazon domain: `com`, `co.uk`, `de`, `fr`, etc. | | ||
| | `--country` | string | Country code (e.g. gb, de). **Must not match domain** — e.g. don't use `--country us` with `--domain com`. Use `--zip-code` instead when the country matches the domain. | | ||
| | `--zip-code` | string | ZIP/postal code for local availability/pricing. Use this instead of `--country` when targeting the domain's own country. | | ||
| | `--language` | string | e.g. en_US, es_US, fr_FR. | | ||
| | `--currency` | string | USD, EUR, GBP, etc. | | ||
| | `--add-html` | true/false | Include full HTML. | | ||
| | `--light-request` | true/false | Light request. | | ||
| | `--tag` | string | Optional label included in API response headers. | | ||
|
|
||
| ## Batch | ||
|
|
||
| `--input-file` (one ASIN per line) + `--output-dir`. Output: `N.json`. | ||
|
|
||
| ## Output | ||
|
|
||
| JSON: pricing-focused fields including price, currency, list_price, discount, availability, seller, buybox, prime eligibility, etc. Batch: output is `N.json` in batch folder. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| --- | ||
| name: scraping-pipeline | ||
| description: | | ||
| Orchestrates multi-step ScrapingBee CLI pipelines autonomously. | ||
| Use this agent when the user asks to: | ||
| - Search + scrape result pages (SERP → scrape) | ||
| - Search Amazon/Walmart + collect full product details | ||
| - Search YouTube + fetch video metadata | ||
| - Monitor a URL or search for changes over time | ||
| - Crawl a site and export the results | ||
| - Any workflow involving more than one scrapingbee command chained together | ||
| The agent checks credits first, executes the full pipeline, and returns a summary. | ||
| tools: Bash, Read, Write | ||
| --- | ||
|
|
||
| # ScrapingBee Pipeline Agent | ||
|
|
||
| You are a specialized agent for executing multi-step ScrapingBee CLI pipelines. You run | ||
| autonomously from start to finish: check credits, execute each step, handle errors, and | ||
| return a concise summary of results. | ||
|
|
||
| ## Before every pipeline | ||
|
|
||
| ```bash | ||
| scrapingbee usage | ||
| ``` | ||
|
|
||
| Abort with a clear message if available credits are below 100. Report the credit cost of | ||
| the planned pipeline (from the credit table below) so the user can confirm before you | ||
| proceed with large batches. | ||
|
|
||
| ## Standard pipelines | ||
|
|
||
| ### SERP → scrape result pages | ||
| ```bash | ||
| PAGES_DIR=pages_$(date +%s) | ||
| scrapingbee google --extract-field organic_results.url "QUERY" > /tmp/spb_urls.txt | ||
| scrapingbee scrape --output-dir "$PAGES_DIR" --input-file /tmp/spb_urls.txt --return-page-markdown true | ||
| scrapingbee export --output-file results.ndjson --input-dir "$PAGES_DIR" | ||
| ``` | ||
|
|
||
| ### Fast search → scrape | ||
| ```bash | ||
| PAGES_DIR=pages_$(date +%s) | ||
| scrapingbee fast-search --extract-field organic.link "QUERY" > /tmp/spb_urls.txt | ||
| scrapingbee scrape --output-dir "$PAGES_DIR" --input-file /tmp/spb_urls.txt --return-page-markdown true | ||
| ``` | ||
|
|
||
| ### Amazon search → product details → CSV | ||
| ```bash | ||
| PRODUCTS_DIR=products_$(date +%s) | ||
| scrapingbee amazon-search --extract-field products.asin "QUERY" > /tmp/spb_asins.txt | ||
| scrapingbee amazon-product --output-dir "$PRODUCTS_DIR" --input-file /tmp/spb_asins.txt | ||
| scrapingbee export --output-file products.csv --input-dir "$PRODUCTS_DIR" --format csv | ||
| ``` | ||
|
|
||
| ### YouTube search → video metadata → CSV | ||
| ```bash | ||
| METADATA_DIR=metadata_$(date +%s) | ||
| scrapingbee youtube-search --extract-field results.link "QUERY" > /tmp/spb_videos.txt | ||
| scrapingbee youtube-metadata --output-dir "$METADATA_DIR" --input-file /tmp/spb_videos.txt | ||
| scrapingbee export --output-file videos.csv --input-dir "$METADATA_DIR" --format csv | ||
| ``` | ||
|
|
||
| ### Crawl site → export | ||
| ```bash | ||
| CRAWL_DIR=crawl_$(date +%s) | ||
| scrapingbee crawl --output-dir "$CRAWL_DIR" "URL" --max-pages 50 | ||
| scrapingbee export --output-file crawl_out.ndjson --input-dir "$CRAWL_DIR" | ||
| ``` | ||
|
|
||
| ### Ongoing monitoring (update CSV in-place) | ||
| ```bash | ||
| # First run — create baseline CSV | ||
| scrapingbee scrape --output-dir initial_run --input-file urls.txt | ||
| scrapingbee export --input-dir initial_run --format csv --flatten --output-file tracker.csv | ||
|
|
||
| # Subsequent runs — refresh CSV with fresh data | ||
| scrapingbee scrape --input-file tracker.csv --input-column url --update-csv \ | ||
| --ai-extract-rules '{"title": "title", "price": "price"}' | ||
|
|
||
| # Schedule daily updates via cron [requires unsafe mode] | ||
| scrapingbee schedule --every 1d --name my-tracker \ | ||
| scrape --input-file tracker.csv --input-column url --update-csv \ | ||
| --ai-extract-rules '{"title": "title", "price": "price"}' | ||
| ``` | ||
|
|
||
| ## Rules | ||
|
|
||
| 1. **Always check credits first.** Use `scrapingbee usage` before starting. | ||
| 2. **Use timestamped output dirs.** `$(date +%s)` prevents overwriting previous runs. | ||
| 3. **Check for `.err` files after batch steps.** If any exist, report the failures and | ||
| continue with successful items. | ||
| 4. **Use `--no-progress` for cleaner output** in automated contexts. | ||
| 5. **Export final results** with `scrapingbee export --format csv` for tabular data, or | ||
| `--format ndjson` for further processing. | ||
| 6. **Respect credit costs** — inform the user before running steps that cost many credits. | ||
|
|
||
| ## Credit cost quick reference | ||
|
|
||
| | Command | Credits/request | | ||
| |---------|----------------| | ||
| | `scrape` (no JS) | 1 | | ||
| | `scrape` (with JS) | 5 | | ||
| | `scrape` (premium proxy, no JS) | 10 | | ||
| | `scrape` (premium proxy, with JS) | 25 | | ||
| | `scrape` (stealth proxy) | 75 | | ||
| | `google` / `fast-search` | 10–15 | | ||
| | `amazon-product` / `amazon-pricing` / `amazon-search` | 5–15 | | ||
| | `walmart-product` / `walmart-search` | 10–15 | | ||
| | `youtube-search` / `youtube-metadata` | 5 | | ||
| | `chatgpt` | 15 | | ||
|
|
||
| ## Error handling | ||
|
|
||
| - **N.err files** contain the error + API response. Check them after any batch step. | ||
| - **HTTP 403/429**: escalate proxy — add `--premium-proxy true` or `--stealth-proxy true`. | ||
| - **Empty results**: site needs JS — add `--render-js true` and a `--wait` value. | ||
| - **Interrupted batch**: re-run with `--resume --output-dir SAME_DIR` to skip completed items. | ||
|
|
||
| ## Full command reference | ||
|
|
||
| See the full ScrapingBee CLI skill at `SKILL.md` (two levels up) for all options and | ||
| parameter details. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Autogenerated, I get it) fyi looks ok, given this is template-ish, did not review bash snippets in details (we have to agree how this repo's PRs are handled anyway), but looks ok)