API Reference Guide
Introduction
General remarks, endpoints
REST API interface
Data structure
Typical Price2Spy API usage scenarios
Price2Spy request authentication
List of operations
Introduction
Introduction
Price2Spy API represents an interface between 3rd party software (referred as ‘external application’) and Price2Spy. It enables accessing and managing Price2Spy data programmatically, without any need for human interaction.General remarks, endpoints
General remarks, endpoints
- Environments
- Production environment (price checks regularly done)
- REST interface
- REST API Endpoint: https://api.price2spy.com/rest/v1
- Documentation and testing (Swagger) URL:
https://api.price2spy.com/rest/swagger-ui.html#/
- Price2Spy GUI – https://spy.price2spy.com/price2spy
- Client ID and Client Secret – please contact support@price2spy.com
- REST interface
- Development environment
- The development environment is there for you to test if the logic of your app works as expected
- Price2Spy does not have a separate development environment for you to use. However, we can open a TEST Price2Spy account for you, which will be used to test your app logic
- If you need such TEST account, please contact support@price2spy.com
- TEST account will by default be empty, please let us know if you’d like some products / URLs copied from your PRODUCTION account
- Production environment (price checks regularly done)
- Timestamps
- REST interface: both response and request use UTC
- All prices/currencies are as captured on-site (setting ‘show all prices in my currency’ not taken into account)
REST API interface
REST API interface
Price2Spy offers API access exclusively through a REST interface.
This document covers common Price2Spy topics related to REST interface.
- REST – the documentation is provided in standard Swagger format: https://api.price2spy.com/rest/swagger-ui.html#/
- REST Authentication is performed by adding Authorization header to your REST API requests. The contents of the header is Basic
Example: Authorization = Basic YmI1MTkzYTdkMzM4YTZmOTEwZmZiYjAxZjhmMzA2YTZlMjJjNDk3Ng==
- REST Authentication is performed by adding Authorization header to your REST API requests. The contents of the header is Basic
Data structure
Data structure
Price2Spy data structure backbone consists of 3 objects.- Product – usually represents an item sold on an online store. Contains one or more URLs from different websites.
- URL – concrete page where the above product can be found on given website. Contains one or more measurements (price checks).
- Measurement (or price point) – concrete result of a price check performed by Price2Spy. A price point gets stored in Price2Spy only if it’s value differs to what was captured in previous price check.
![Price2Spy® API Reference Guide](https://www.price2spy.com/wp-content/uploads/2022/05/image2.png)
Typical Price2Spy API usage scenarios
Typical Price2Spy API usage scenarios
In this chapter, we will try to cover typical scenarios on how your application (referenced as ‘external application’) can interface Price2Spy.A) Full integration: External app. supplies Products and URLs; Price2Spy supplies pricing data
![Price2Spy® API Reference Guide](https://www.price2spy.com/wp-content/uploads/2022/05/image4.png)
B) Partial integration: Products and URLs manually entered in Price2Spy, Price2Spy feeds pricing data to external app.
![Price2Spy® API Reference Guide](https://www.price2spy.com/wp-content/uploads/2022/05/image3.png)
C) Partial integration: External application supplies Products and URLs; Price2Spy price change alerts used
![Price2Spy® API Reference Guide](https://www.price2spy.com/wp-content/uploads/2022/05/image5.png)
Price2Spy request authentication
Price2Spy request authentication
Request for each Price2Spy operation consists of 2 parts
- Request-specific element (example for insert operations: insert)
- apiKey – used to authenticate you to Price2Spy API. Can be found when you log in to Price2Spy – Settings
Possible authentication-related faults (applicable to all operations)
- apiKeyWrong – check if you have supplied correct API key
- apiAccessNotAllowed – please check if this is enabled in your Settings
An API key alternative is the Client ID + Client Secret combination.
Both can be generated in your Price2Spy account by going to Integrations and then to API.
List of operations
List of operations
- Managing Price2Spy data (insert / update / delete operations)
- insertProduct
- updateProduct
- deleteProduct
- insertUrl
- updateUrl
- deleteUrl
- insertCategory
- updateCategory
- deleteCategory
- insertBrand
- updateBrand
- deleteBrand
- insertSupplier
- updateSupplier
- deleteSupplier
- insertMetadata1
- updateMetadata1
- deleteMetadata1
- insertMetadata2
- updateMetadata2
- deleteMetadata2
- insertMetadata3
- updateMetadata3
- deleteMetadata3
- Retrieving Price2Spy data (‘get’ operations)
- getProducts-get products for given search criteria
- getUrls – get URLs for given product(s)
- getMeasurements – get price checks (measurements) for given URL
- getCurrentPricingData – get all Price2Spy data for products matching given search criteria
- getBrands – get all brands
- getCategories – get all categories
- getSuppliers – get all suppliers
- getMetadata1 – get all metadata1 fields
- getMetadata2 – get all metadata2 fields
- getMetadata3 – get all metadata3 fields