KPN

Internet Speed Check - KPN

KPN

Retrieve maximum internet bandwidth and carrier types for any address

Easily check addresses in the Netherlands for free

  • Network

API reference on SwaggerHub

Introduction

Find out the maximum available upload and download speed for any given address in the Netherlands. Also get insight into the technologies (copper, bonded copper or fiber) that are available for an address.

Conceptual model

Conceptual model

API workflow

API workflow

Getting started

Authentication

To authenticate you'll need to request an access token. Use your API Store app's credentials (Consumer Key and Consumer Secret) to make an authentication request. The authorization service returns a JSON message that contains the access_token field.

Use one of the following 3 options:

cURL

Execute below cURL command to receive an access token. Replace APP_CONSUMER_KEY and APP_CONSUMER_SECRET with your app's credentials.

curl -X POST \
 'https://api-prd.kpn.com/oauth/client_credential/accesstoken?grant_type=client_credentials' \
 -H 'content-type: application/x-www-form-urlencoded' \
 -d 'client_id=APP_CONSUMER_KEY&client_secret=APP_CONSUMER_SECRET'

If you are using cURL for Windows, please use the command below instead.

curl -X POST "https://api-prd.kpn.com/oauth/client_credential/accesstoken?grant_type=client_credentials" -H "content-type: application/x-www-form-urlencoded" -d "client_id=APP_CONSUMER_KEY&client_secret=APP_CONSUMER_SECRET"

The authentication service returns a JSON message that contains the access token field.

{
    "refresh_token_expires_in": "0",
    "api_product_list": "[xxxxxxx]",
    "api_product_list_json": [
        " xxxxxxx"
    ],
    "organization_name": "kpn",
    "developer_email": "demo123@kpn.com",
    "token_type": "Bearer",
    "issued_at": "1521039195424",
    "client_id": "APP_CONSUMER_KEY",
    "access_token": "haf2SDl07E9N7RluNQ4kJ1TkGgso",
    "application_name": "6e38edxxxxxxxxxxxxxxxx4065d79c",
    "scope": "",
    "expires_in": "3599",
    "refresh_count": "0",
    "status": "approved"
}

SwaggerHub

  1. Click on the Authorize button on the top right.
  2. In the form, fill in client_id and client_secret, using your app's credentials.
  3. Click Authorize.

Postman

When using Postman, you will have to import the Swagger file into a Postman collection as follows:

  1. Open the API reference on SwaggerHub.
  2. On the top right, click Export, click Download API and click 'YAML Unresolved'.
  3. In Postman from the menu click File and click Import... Choose the YAML file you downloaded in the previous step. A new collection will be added.
  4. Select Get Access Token from the collection.
  5. Make sure the right environment is selected, corresponding to the API.
  6. Edit the environment variables client_id and client_secret, using your app's credentials.
  7. Check the response code and message.
  8. Press the Send button to get an access token.

Note: Request variables are no longer linked to an environment, but to the collection.

How to...

Retrieve maximum internet speed and carrier type for an address

We are going to use this data as example data to call /offer endpoint (with a full path of https://api-prd.kpn.com/network/kpn/internet-speed-check/offer)

"service_address": {  
    "house_number":3,
    "zip_code":"3544ZE",
    "house_number_extension":""
}

Since it's a valid address, the alerts field will not be populated and the result of the call will look like the following:

{
    "available_on_address": {
        "technologies": [
            {
                "name": "FIBER",
                "download": 500,
                "upload": 500,
            },
            {
                "name": "COPPER",
                "download": 16,
                "upload": 2,
            },
            {
                "name": "COPPER",
                "download": 12,
                "upload": 1,
            },
            {
                "name": "NoAccess",
                "download": 0,
                "upload": 0
            }
        ],
        "house_number_extensions": [],
    },
    "max_bandwidth": {
        "up": 500,
        "down": 500
    },
    "alerts": [],
}

Return codes

Code   Description
200   Success
201   Created
202   Accepted
302   Found. Link in location header
400   Bad request
401   Unauthorized
403   Forbidden
404   Not found
405   Method not allowed
412   Precondition failed
429   Too many requests
500   Internal server error
502   Bad gateway
503   Service unavailable