Accessing the COMPARE resource

The compare resource allows to compare various products in the database of Aanbieders.be.

The HTTP method

There is currently one HTTP method that allows to compare producs

Resource

HTTP format

URL.format

Description

Compare

GET

/compare.json

Returns a list of products

Build a valid API KEY

The API KEY is a required parameter and should be present in each request you make.
The key is build using a public key, a private key a nonce and a timestamp. See here for a detailed description on how to create a valid api key.

Define the parameters

To create a compare succesfully, you need a set of general parameters and a set of parameters based on the producttype you wish to compare for.

General parameters

Name

Parameter

Required

Type

Description

Public key

key

yes

string

Public key issued to you after registration

API key

apikey

yes

string

Calculated key

Unix timestamp

timestamp

yes

string

Unix timestamp used to calculate the api key

Nonce

nonce

yes

string

Number used only once in the same second used to calculate the api key

Product type

cat

yes

string

Type of product

Current supplier

cs

no

numeric

id of the current supplier (-1 = Other Supplier as listed, -2 = Unknown, -3 = No Supplier)

Language

lang

yes

nl / fr

Language indicator

Segment

sg

yes

consumer / sme

Segment indicator

Preferred supplier(s)

pref_cs

no

numeric / array

List only products of specific suppliers

Preferred product(s)

pref_pids

no

numeric / array

List only specific products

Compare to product id

cmp_pid

no

numeric

Compare results with the given product

Exclude Supplier(s)

excl_sids

no

numeric / array

Exclude the specified suppliers from the results

Exclude Product(s)

excl_pids

no

numeric / array

Exclude the specified products from the results

Region code

re

no

vl / w / b

One of the above region codes in lowercase

Postalcode

zip

no

numeric

Valid Belgian postal code

Sort method

sort

no

numeric

Sort method

Detaillevel

detaillevel

no

array

Level of detail in response (see detaillevel-chapter)

Grouping

grouping

no

string

Grouping of results "productgroup" (default) / "supplier"

Only promo items

promo_offers_only

no

1 or 0

If 1, only products that have an active promotion are returned

Ignore promotions

ignore_promos

no

1 or 0

If 1, all promotion offers are not taken into account during calculations

Ignore options

ignore_options

no

1 or 0

If 1, all additional options are not taken into account during calculations

Electricity parameters

Name

Parameter

Required

Type

Description

Usage day

du

yes

integer

Usage (day rate) in kWh.

Usage night

nu

no

integer

Usage (night rate) in kWh. Default 0. If > 0, MRU type day/night will be used for GRD tarification.

Minimum response time ico. technical issues, expressed in hours. (8 or 24). Only for SME

Num. PCs

num_pc

no

numeric

How many computers will be using this internet connection

Free calling

vtf

no

'offpeak' / 'peak'

'offpeak' or 'peak' for free calling to fixed lines

Mobile Internet parameters

Name

Parameter

Required

Type

Description

Volume

int

yes

numeric

Download volume in MB

Device

device

yes

enum

blackberry / ipad / tablet / laptop

Detaillevel

Detaillevel gives you the possibility to scale down the response array. When you only need texts, you can add texts to your detaillevel array and will only get the text array in your output.

In this case, you have the choice in:

contract_periods

availability

texts

links

supplier

options

promotions

attachments

reviews

order_preferences

specifications

applied promotions

pricing

When you compare with a current product, you will also receive a savings key in your response, which will tell you how much you can save when changing to this product.

Performance tip

To speed up the request, scale down your response as much as possible with the detaillevel parameter. Texts can be quite large and will create a larger json-file to send over HTTP.
Only request the information you really need!

Example : compare products of type 'gas'

Results

Now perform a HTTP POST using your generated REST url and catch the result. This could be as simple as copying the rest url into your browser's address bar.
While this could be perfect for a test , you will want to write a script that calculates the api key, builds the URI and preforms a GET while catching and interpreting the response.