market-sniper
Golang part of backend for Market Sniper
Installation
- Clone the repository
- Run
go get
to install dependencies
- Generate a self-signed certificate and key and place them in the
tls
directory by go run path/to/generate_cert.go --host=localhost
- Run
go run ./cmd
to start the server
- The server will be running on
https://localhost:4000
Endpoints
GET /api/v1/getProducts
Returns the info about product
curl --request GET
--url http://{host}:{gateway_port}/v1/getProducts
--header 'Content-Type: application/json'
--header 'X-Api-Key: your_api_key'
--data '{
"ASIN": ["B07VGRJDFY", "B207Z4RZ9C"],
"country": "US",
"tld": "com"
}'
RESPONSE
[
{
"ASIN": "B07VGRJDFY",
"Title": "Apple iPhone 11 Pro Max, 256GB, Midnight Green, Fully Unlocked (Renewed)",
"Brand": "Apple",
"Price": "999.99 $",
"Previous_price": "1099.99 $",
"Change_date": "2021-07-01T00:00:00Z"
},
{
"ASIN": "B207Z4RZ9C",
"Title": "Apple iPhone 11 Pro Max, 256GB, Midnight Green, Fully Unlocked (Renewed)",
"Brand": "Apple",
"Price": "999.99 $",
"Previous_price": "1099.99 $",
"Change_date": "2021-07-01T00:00:00Z"
}
]