The idealo Insights API is secured by OAuth2. At a high level, you follow four steps:

  1. Obtain OAuth2 credentials from idealo Business.

  2. Obtain an access token from the authorization server.

  3. Do an idealo Insights API request with the access token in the Authorization header.

  4. Refresh the access token, if necessary.

Credentials

To access the API you need a client id and a client secret. You can generate them in idealo Business under 'API clients' → 'idealo Insights API'.

Note
The client secret is only shown once at creation time! If you no longer have access to it or forgot it, create new credentials and delete the old ones.

Access token

To generate an access token, do a POST request against the authorization endpoint and use your client id and client secret for HTTP Basic authentication.

Request headers

Header Description

Authorization

Basic followed by the Base64 encoded clientId:clientSecret.

Content-Type

application/x-www-form-urlencoded

Request body

Parameter Description

grant_type

Always client_credentials.

Example request

POST /mer/businessaccount/api/v1/oauth/token HTTP/1.1
Host: api.idealo.com
Authorization: Basic <place your Base64 encoded clientId:clientSecret here>
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials

The same request with curl:

$ curl 'https://api.idealo.com/mer/businessaccount/api/v1/oauth/token' -i -X POST \
    -u '<clientId>:<clientSecret>' \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    -d 'grant_type=client_credentials'

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
  "access_token" : "eyJraWQiOiJrMSIsImFsZyI[...]",
  "token_type" : "bearer",
  "expires_in" : 3600,
  "scope" : "INSIGHTSAPI:READ_REPORTS",
  "shop_id" : 123456
}

Response fields

Path Type Description

access_token

String

The access token (a JWT). Provide it in the Authorization header of every API request.

token_type

String

The token type. Always bearer.

expires_in

Number

The lifetime of the access token in seconds.

scope

String

The scopes granted to the token. Must include INSIGHTSAPI:READ_REPORTS.

shop_id

Number

The shop id the access token is valid for.

The access token is a JWT; you can decode it, for example with jwt.io, to inspect its claims.

Using the access token

Send the access token in the Authorization header of every request:

GET /api/v2/shops/123456/reports/price-competitiveness HTTP/1.1
Host: insights.idealo.com
Authorization: Bearer <access-token>
Accept: application/x-ndjson

Refresh the access token

The access token expires after some time, by default 3600 seconds. There is no refresh token: to refresh it, just get a new one as described under Access token.

Token requirements

The access token must be a JWT carrying:

Claim Requirement

aud

Must include insights-api. Otherwise the request is rejected with 401.

client_id

Must be present. Otherwise the request is rejected with 403.

scope

Must include INSIGHTSAPI:READ_REPORTS.

shop_id

Must match the shopId path segment of the request. A mismatch is rejected with 403 (see Problems).