Skip to main content
Wiser Live Prices API
R
Written by Raniel
Updated over 5 months ago

Content

  • Overview

  • API Request Format

  • API Response Format

  • Cache Mechanism

  • API Registration and Throughput

  • Testing the API

  • Other API Responses

  • Securing the Communication

Overview
The Live Prices API is a REST API endpoint that allows two software systems to talk to each other via a request/response-based communication. This API fetches and returns real-time data on Price, Regular Price, Shipping Price, and Availability for each competitor product listing currently matched to the requested SKU.

API Request Format

Base URL: https://static-api.360pi.com
Path: /api/v1/live/<product_id>?key=<your_key>
Method: GET.

  • Replace <product_id> with the competitor product ID ("id") retrieved from the Product API endpoint response. Note: See the Product API article for more information.

  • Replace <your_key> with your API authentication key. Note: Please see the 'Registering your application' section in this document for more information.


​API Response format

{"products": [ 
{
"shipping": <float>, // product listing's shipping price
"shipping_price": <float>, // same values as 'shipping' field
"price": <float>, // product listing's price
"availability": <boolean>, // product listing's stock information
"id": <str>, // unique id of this product in Wiser systems
"url": <str>, // product listing URL
"crawl_date": <date YYYY-MM-DDTHH:MM:SS>, // last crawl timestamp in UTC
"store_name": <str>, // e-commerce store name
"in_cart": <boolean>, // if price was extracted after adding item to cart
"regular_price": <float> // listing's regular price, aka “strike through price”
}
],
"status": "OK"
}


Note: If you're subscribed to regional price intel (multiple zip codes set for a particular competitor domain), the Live Prices API endpoint will always return data for the main zip code only.


Cache Mechanism

The Live Prices API endpoint uses a caching mechanism to improve response times. When you request the live price of a product, the API caches the extracted price for 1 hour. And if you make another request to get a live price for the same product in less than 1 hour, then it will return the cached price instead. If you request this same product more than 1 hour later, then it will fetch the price from the product's page again in real-time.

​API Registration and Throughput

Your application needs an API key to authenticate the requests made to the Wiser API endpoints. If you have multiple environments (catalogs), you will need a key for each one of the environments or only for the one(s) you wish to use APIs.

Each API key has a rate limit of 200 requests per minute, and the total monthly usage is also limited per key. This API typically responds with data in less than 2 seconds, excluding any client-side network speed restrictions, but it may take longer to run a real-time extraction depending on which e-commerce websites are being extracted.

Please reach out to your Wiser representative for more information about creating a key and configuring usage limits.

Testing the API

For a simple test, you can make API requests and see the responses using a simple web browser (ex: Google Chrome). You just need to insert the full URL in the browser with the right parameters.

Example:


Other API Responses

During implementation, besides successful response data, your application also needs to be prepared to handle these other response scenarios.

  • Incorrect competitor product id:

    • Response code: 500

    • Response data: {"status": "error"}

  • Incorrect API key:

    • Response code: 401

    • Response data: {"status": "error"}

  • Timeout:

    • Response code: 504

    • Response data: NA

    • Note: The response will timeout after 210 seconds.

  • Usage limit reached:

    • Response code: 200

    • Response data:

{
"status": <str>"error"
"reason": <str> "Too many requests",
"limit": <int>
"key": <str>
"hit_rate": <int>
}
  • Not able to extract data from the product page:

    • Response code: 200

    • Response data: The response will have the same format and attributes as a regular successful response, but prices and availability will be null.

{
"products": [
{
"shipping": null,
"shipping_price": null,
"price": null,
"availability": null,
"id": <str>,
"url": <str>,
"crawl_date": <date YYYY-MM-DDTHH:MM:SS>,
"store_name": <str>,
"in_cart": <boolean>,
"regular_price": null,
}
],
"status": "OK"
}
  • Note: Reasons for not being able to extract prices from a product page vary. It can be a momentary reason such as website traffic blocking or a permanent reason, such as a product no longer listed on the website.

  • Tip: rely more on the response data to interpret the results rather than the response codes, as the response code 200 here means the request was authenticated and an extraction attempt was performed.

Securing the Communication
​Data security is critical when integrating with Web APIs. Please make sure you're using common security practices, such as using proper connection security using HTTPS and keeping your API secret key safe to ensure bad actors cannot access your data.

Common security mistakes include sharing the complete request URL (including your API key) with peers in insecure channels, which may expose the API key to bad actors. So please review your data security policies and processes accordingly.

Did this answer your question?