Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tuhinpal/amazon-api
Serverless Amazon Search and Product API, runs on Cloudflare worker. Supports multiple country's amazon version.
https://github.com/tuhinpal/amazon-api
amazon amazon-api amazon-scraper cloudflare cloudflare-worker cloudflare-workers
Last synced: 2 days ago
JSON representation
Serverless Amazon Search and Product API, runs on Cloudflare worker. Supports multiple country's amazon version.
- Host: GitHub
- URL: https://github.com/tuhinpal/amazon-api
- Owner: tuhinpal
- Created: 2021-03-29T05:51:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-05T06:31:08.000Z (8 months ago)
- Last Synced: 2024-12-13T04:36:56.379Z (9 days ago)
- Topics: amazon, amazon-api, amazon-scraper, cloudflare, cloudflare-worker, cloudflare-workers
- Language: TypeScript
- Homepage: https://amazon-api.tprojects.workers.dev
- Size: 73.2 KB
- Stars: 111
- Watchers: 3
- Forks: 142
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Amazon API
This project is a comprehensive edge API for Amazon. It supports search and product endpoints. The search endpoint allows you to search for products on Amazon. The product endpoint allows you to get product details by ASIN. This API supports both `REST` and `GraphQL` endpoints.
## Changelog π
1. May 5, 2024 - Amazon blocked Cloudflare ASN
It seems like Amazon has blocked Cloudflare ASN. So, the API will work in development mode only. It uses hono, so it is possible to deploy the project on any other cloud provider.
2. May 5, 2024 - Don't use the hosted API
Please don't use the hosted API. Deploy your own instance of the project. The hosted API is for demonstration purposes only. The hosted API may be taken down at any time.
3. May 5, 2024 - V2 is here
I rewrite the full project from scratch. The new version is written in TypeScript and uses Cloudflare Workers. This version is faster and more reliable and also supports GraphQL.
Changes:
- Rewrite the full project in TypeScript
- Used Hono
- Add GraphQL support
- Add support for multiple country versions of Amazon
- Add support for paginationCheers π
## Features π
- Support multiple country versions of Amazon
- Search for products on Amazon
- Get product details by ASIN
- Supports both REST and GraphQL endpoints
- Supports pagination## Tech Stack π»
- Cloudflare Workers
- Hono
- TypeScript
- GraphQL
- REST## REST API π
| Path | Method | Description | Try it out |
| :---------------------------- | :----- | :------------------------------------- | :--------------------------------------------------------------------------------------- |
| /api/[country]/search | `GET` | The country code of the Amazon website | [Try it out](https://amazon-api.tprojects.workers.dev/api/in/search?query=iphone&page=1) |
| /api/[country]/product/[asin] | `GET` | The country code of the Amazon website | [Try it out](https://amazon-api.tprojects.workers.dev/api/in/product/B0CVL69Y27) |## GraphQL API π
- The graphql endpoint is available at `/graphql`.
- Try out the playground at [/graphql/playground](https://amazon-api.tprojects.workers.dev/graphql/playground).## Deployment π
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/tuhinpal/amazon-api)
## Implented country versions π
| Country | Code | Base URL | Implementation |
| :----------- | :--- | :----------------------------------------- | :------------- |
| India | in | [amazon.in](https://www.amazon.in) | `Full β ` |
| USA | us | [amazon.com](https://www.amazon.com) | `Partial π§` |
| England | uk | [amazon.co.uk](https://www.amazon.co.uk) | `Partial π§` |
| Canada | ca | [amazon.ca](https://www.amazon.ca) | `Partial π§` |
| Germany | de | [amazon.de](https://www.amazon.de) | `Partial π§` |
| France | fr | [amazon.fr](https://www.amazon.fr) | `Partial π§` |
| Italy | it | [amazon.it](https://www.amazon.it) | `Partial π§` |
| EspaΓ±a | es | [amazon.es](https://www.amazon.es) | `Partial π§` |
| Australia | au | [amazon.com.au](https://www.amazon.com.au) | `Partial π§` |
| Japan | jp | [amazon.co.jp](https://www.amazon.co.jp) | `Partial π§` |
| Brazil | br | [amazon.com.br](https://www.amazon.com.br) | `Partial π§` |
| Saudi Arabia | sa | [amazon.sa](https://www.amazon.sa) | `Partial π§` |
| UAE | ae | [amazon.ae](https://www.amazon.ae) | `Partial π§` |## Legal Disclaimer βοΈ
Accroding to some website it is not illegal to scrape public data from Amazon. I am not responsible for any misuse of this API. Use it at your own risk. This project comply with these terms:
- Not making excessive requests to Amazon website
- Not interfering with Amazonβs website or services
- Not using Amazonβs trademarks or logos**Are you from Amazon? and want to take down this project?** Sure, I will happy to do that. Well, see the new version of the project was written just to test, how fast I can write a production ready scraper (BTW it took 3 hours only). So my mission was accomplished. Just create an issue and I will make this project private.