Price2Spy API 101 – Explanation For Business Teams
Plain-language guide

How the Price2Spy API works

Everything a manager or decision-maker needs to know about connecting Price2Spy to your other systems. No technical background needed.

About 10 minutes to readFor business teams, project owners and managersDevelopers: see the API documentation

1What is the API?

Price2Spy tracks competitor prices online. The API (application programming interface) is a door through which your other software, such as your ERP, web shop or internal system, can talk to your Price2Spy account automatically, without anyone clicking through the application.

Through the API, your systems can read and change the data in your account:

  • the products you track
  • competitor links: pages in other shops where the price of your product is tracked
  • the shops those links are on
  • price history and current prices
  • supporting lists such as brands, categories and suppliers
In shortThe API connects price tracking to the rest of your business systems, so data is exchanged automatically.

2What you need to get started

Price2Spy issues two values per account, similar to a username and password. Your Price2Spy contact also gives you the server address that requests are sent to.

Client ID

Like a username

A public identifier that says "this is that account".

Client secret

Like a password

A secret key. Never send it to anyone, not even to Price2Spy support.

Server address

Where to connect

The exact address your systems send their requests to.

Every request automatically sees only your account's data. There is no way to access someone else's data by accident.

3How Price2Spy knows a request really comes from you

Every request must be signed. Think of it as a seal on a document: your program takes the content of the request and the secret key, and calculates a unique signature from them.

1

Your system signs

It combines the request with your secret key to produce a signature.

2

The request travels

It is sent with the signature and the exact time it was created. The secret key itself is never sent.

3

Price2Spy checks

It repeats the same calculation. If the signatures match, the request is accepted.

If anyone tampers with the request along the way, changing even a single character, the signature no longer matches and the request is refused.

Key points

  • The time must be correct. A signature is valid only within 15 minutes of Price2Spy's clock, so the clock on the server sending the requests must be set correctly.
  • Every request is signed afresh. A signature is never used twice.
  • The secret key stays on your server. It is never built into a web page or a mobile app, where anyone could read it.
This is the developers' part of the workThe most common connection problem is a mismatched signature. The API documentation includes ready-made examples in Java, C#, Python and JavaScript, test values for checking, and a troubleshooting checklist.

4General rules

Data arrives in pages

When you ask for a list, for example all products, the answer arrives page by page, like Google search results. The default is 20 items per page, and you can ask for up to 500 (at most 50 for the current-prices view). Each page also says how many results there are in total and how many pages.

Four basic actions

ActionMeaningNote
Read GETView dataChanges nothing in the account.
Create POSTAdd a new recordFor example, a new product or a new competitor link.
Update PATCHPartial changeOnly what you send is changed. Everything else stays as it was.
Delete DELETERemove a recordDeleting a product also deletes all its links and price history. It cannot be undone.

Things to watch out for

Misspelled fields are ignored

If a program sends targetPrise instead of targetPrice, nothing changes and no error is shown. Always compare the response with what was sent.

Prices

From 0 to almost 10 billion, never negative, stored with two decimal places.

Currency

Prices are converted to your account currency when an exchange rate exists. Otherwise they stay in the shop's currency. The response always says which. Shipping costs and shelf prices are never converted.

Dates and time zones

A date sent without a time zone is read as Central European Time (Paris, Belgrade). This often explains why a date search returns fewer results than expected.

One year of history

Pricing data can be requested at most one year back, for a period no longer than one year.

Request limit

Each account may send a limited number of requests per second, for example 4. If it's exceeded, wait one second and try again. Ask your Price2Spy contact if you need more.

5What you can do

The API covers 8 areas with 43 functions in total.

AreaWhat it allows, in plain words
ProductsSearch, add, change and delete the products you track. Each product can have a code (SKU), purchase and target price, upper and lower price limits, brand, category, supplier, 10 free fields and 2 comments. You also set how often prices are checked, in days or hours depending on your plan.
Links (URLs)Add links to competitor pages for each product. A product can have only one link per shop. A link can be paused, changed or deleted. A "multiplier" handles cases such as a competitor selling a pack of 2.
Sites (shops)The shops where you have at least one link. Give them your own name or a priority, or exclude them from email alerts.
MeasurementsEach individual price check of one link: price, availability, promotion, shipping, stock status, seller and a screenshot of the page at the time of the check.
Pricing dataThree ready-made views: links whose price changed most recently, the full price history of one product, and the current picture of all products with current and previous prices and your own price.
Price bucketsHow your products are spread across price ranges (for example €0–50, €50–100) and how many products fall in each.
Supporting listsBrands, categories, suppliers and three lists of your own. View, add, change or delete entries, each with its own alert email addresses. An entry used by at least one product cannot be deleted.
AutomatchPrice2Spy finds competitor pages that probably match your products. Accept a suggestion to make it a tracked link, reject it, or undo an acceptance made by mistake.
Plan limits applySome actions depend on your Price2Spy plan, such as how often prices can be checked or how many active links and shops you may have. If a limit is exceeded, the change is refused with an explanation.

6What error messages mean

When something fails, the system returns a number (status code) and a short message. These are the most important ones.

CodeMeaningWhat to do
400The request is not valid: a wrong value, a bad date, or the clock is wrongCorrect the data or set the server clock.
401Price2Spy did not recognise you: wrong signature or key, or the API is not enabled for the accountThe developer checks the signature. If everything is correct, contact Price2Spy.
403The record may not be changedDon't try again.
404The record does not exist in your accountCheck the record's identifier (ID).
409Conflict with existing data, such as a name already taken or a plan limit reachedChange the value or check your plan.
429Too many requests per secondWait a second and try again.
500An error on Price2Spy's sideTry later. If it keeps happening, send Price2Spy the error ID from the message.

A search that finds nothing is not an error. It simply returns an empty list.

7Key points

  • Security is well designed. Every request is signed, limited to your account and valid only for a short time. Your only responsibility is to keep the secret key secret.
  • The integration is complete. Everything done by hand in the application (products, links, prices, lists, automatic suggestions) can be automated.
  • Deletion is permanent. Deleting a product or link also removes its price history. Control such actions carefully in the integration.
  • There are limits. Requests per second, one year of history and plan rules. Keep them in mind when planning.
  • Getting help. Send your Price2Spy contact a description of the request, the address and the time of the failed attempt, but never the secret key.