Staring from September 2017, Sniffie provides Product feed (i.e. Product API) as a separate entity from raw web data extraction API. In most cases, this is the kind of API you really want to use. This guide will explain how Sniffie product feeds work.

Should you not understand how to use this documentation or have any questions/feedback regarding the documentation features, please contact Sniffie support.

Should you need lots of data (especially history data) fast and often, direct SQL access is available as an extra feature. Please contact your Sniffie contact person for details. If you already have SQL access and are wondering about the credentials, please contact your organization’s account owner (“superuser”) for details. If your SQL credentials are missing, Sniffie support can create new credentials upon the account owner’s verified authorization to do so.

How it works

Sniffie product API is available at https://api.sniffie.fi/v1/. Creating product API links is simple anywhere where Sniffie’s filters for analytics are used. When you activate any filters, a new option “Export product feed” appears next to Save This Filter button.

Export product feed and save filters buttons
Export product feed and save filters buttons

When you click that button, a modal opens that gives you the option to save the link.

Product feed saving modal
Product feed saving modal

After giving your link a name and description, you are able to save the link. The link will appear under saved API links. The created link is also returned and shown you in the confirmation modal. You may also download the results in csv-format by clicking the button in the confirmation modal.

Successful product feed creation
Successful product feed creation

The API identifier is unique to your account and your filters. This means that only the data specified in the filter that was active during link creation can be fetched. This means that if the link leaks out, nobody can access any other part of  data in your account other than that specified by the filters. All requests (and the originating IP) are logged in our system and can be viewed by the user under API usage. Current limit for poll rate is 60 request in minute, up to 1000 requests in one hour. The limits are subject to change. By default, only pricing info is returned. Availability information can be requested with an appropriate parameter (read below).

Sniffie product feed returns up to 10.000 rows at a time. Results are always delivered in the order from the earliest to the latest unless otherwise specified. The product feed results can further be filtered by passing certain parameters in the link (explained below). The API supports html table, csv, json and xml output formats.

If you have any problems opening the CSV file on your system, read this guide.

Available columns via Sniffie product feed (when asking for latest data product data)

If available, all default columns available in the Sniffie extension are returned in the product feed results. The list contains the following:

Category
Website
Store name
Product name
Brand
Unit
Price
Currency
Original price
Unit price
Description
Rating
Product code
Product image

Additional columns that are returned include the following (if available):

Product page url
Match status
Match code
Match name

Additionally, any enriched columns are returned, regardless of how they are named.

Note that as of Sniffie v0.7.0.5, using the column “Other” and specifying anything customized on the category page is not returned on the product feed. This will be changed by summer 2018.

Note that you are able to view your raw data (i.e. available columns) also under Data sources in Sniffie service..

Available columns via Sniffie product feed (when asking for history data)

The following columns are returned should you ask for history data from the Sniffie product feed:

Category
Website
Store name
Product name
Brand
Unit
Price
Currency
Original price
Unit price
Description
Rating
Product code
Product image

The columns above are the default columns available in the Sniffie extension. Enrichment data is not returned should you as for product history data. This is because enrichment is only done once and it will not change.

Please note that when you ask history data for 10.000 products, only the latest results will be returned (10.000 global row limit for the web API).

Available columns via Sniffie product feed (when asking for availability data)

The following columns are returned should you ask for history data from the Sniffie product feed:

Product name
Website
Brand
Product code
Store name
Date
Availability in text
Availability in numeric format
Price

Formatting Product API Results

Sniffie Product API accepts either GET or POST requests. Unique API identifier and products parameter are required. Parameters can be added to the request (either POST of GET). If you use GET-requests, you can add parameters with

&{{parameter name}}={{parameter value}}

, where {{parameter name}} is the name of the parameter and {{parameter value}} is the value of the parameter. Consult the parameter list below for options that you can pass to the product feed.

Possible Parameters for Formatting API Results

products

fetches the latest matched product information

k

Unique API identifier key for this product feed, 128 characters long. The key is generated at the time of API link creation. Each API identifier is unique.

format

specifies the data format, defaults to json. Currently supports json, html, xml, csv.

limitC

limits the number of rows processed from product catalogue. Minimum value 0, maximum value 10000. Defaults to 1000.

offsetC

specifies the starting index of product catalogue results. Minimum value 0. No maximum value (if over the number of possible results, no rows are returned). Defaults to 0.

limitH

limits the number of rows processed from product history. Minimum value 0, maximum value 10000. Defaults to 1000.

offsetH

specifies the starting index of product history results. Minimum value 0. No maximum value (if over the number of possible results, no rows are returned). Defaults to 0.

from

specifies the starting date. Defaults to none (gets the latest data up to the request time). Format YYYY-MM-DD.

to

specifies the ending date. Defaults to none (gets the latest data up to the request time). Format YYYY-MM-DD.

history

fetches history data for data, needs to be set if historical values are wanted (value doesn’t matter)

availability

fetches availability data for the data, needs to be set if historical values are wanted (value doesn’t matter).

Examples (for GET-requests)

https://api.sniffie.fi/v1/?products&k=123&format=html

returns product catalogue data for identifier key 123 in html table format.

https://api.sniffie.fi/v1/?products&k=123&format=json&limitC=60

returns product catalogue data for identifier key 123 in json format, limits results to 60 rows.

https://api.sniffie.fi/v1/?products&k=123&format=html&limitC=60&offsetC=100&history=1

returns product distory data for identifier key 123 in html format, limits results to 60 rows and offsets the results from 100 (i.e. starts from the 100th item)

https://api.sniffie.fi/v1/?products&k=123&format=xml&offsetH=100&from=2017-08-20history=1

returns 1000 rows product distory data for identifier key 123 in html format since 2017-08-20, offsets the history results by 100 (i.e. starts from the 100th item).

https://api.sniffie.fi/v1/?products&k=123&format=csv&to=2017-08-20history=1

returns 1000 rows product distory data for identifier key 123 in csv fromat up to the date 2017-08-20

Product API uses your product catalogue and Sniffie’s analytics filters as a basis for data extractions. It does not use your API key nor will it return results for raw extractions. Only data that is related to products can be returned.

Errors

200 - No data to be fetched.

There is no longer any data that satisfies the conditions of the filter and associated parameters. Could be cause e.g. having too high limit or offset parameters or if the products in your product catalogue have been removed.

404 - Error. API key is missing in the request.

API identifier was not specified in the request.

404 - No such file or link found. Check your api key.

No such active API identifier found in our system.

404 - Limit exceeded

API limit exceeded. Wait one 1h before trying again. Limit timer will reset after each requests made during limit exceeding. If you exceed the limit on a regular basis, your API access may be automatically revoked by Sniffie.

404 - Error processing match names. Contact Sniffie support!

Match names could not be processed. This kind of an error should be reported to Sniffie support.

404 - Product list could not be fetched.

Product list could not be processed. This kind of an error should be reported to Sniffie support.

Questions?

Please contact Sniffie support!

Tagged: