The LIR Portal "IP Analyser" API

Introduction

The LIR Portal offers an API that allows you to fetch specific information about your Internet number resources. You can get a plain text report or all information in JSON format, containing the following data sets:

  • An overview of all your assignments
  • An overview of available free space in your allocations
  • An overview of all invalid assignments that require your attention

IPv4 data is available in JSON format and plain text. The plain text format is the same as that used by the 'asused' tool. IPv6 data is only available in JSON format and does not display invalid assignments at this time.

When you query the API, data is fetched from the RIPE Database in real time, so it may take some time for results to be returned, especially for larger LIRs. Returned data is cached for five minutes, so if you make a change in the RIPE Database immediately after querying the API, please allow the cache to expire before querying again to see your changes.

Creating an API Access Key

Because the information contained in My Resources is private for your LIR, it is only accessible through the API after creating an access key. In order to do this, please follow these steps:

  1. Log in to the LIR Portal with a user account that has administrator credentials
  2. Click the API Access Keys link in the Tools section
  3. Create a key for the IP Analyser API

Please note that you are responsible for maintaining your keys. You can create as many keys as you like and revoke unused keys as needed.

Usage

After creating an API Access Key, the management screen will allow you to select a data set and output format. After clicking the "Show me" button, you will get the Call URL:

ipanalyser Key for NOC dept

Fetching the data sets

Call URL Formatting

The main service URL for the IP Analyser API is:

https://lirportal.ripe.net/ipanalyser/v1

The URL is appended by the desired data set and the access key as follows:

1. Appending the desired data set:

Data setparameter
IPv4 /ipv4
IPv6 /ipv6

2. Appending the key:

?key=b7f6d966-f33e-4617-b4d7-3b940eded779

3. Appending the output format (IPv6 is only available in JSON):

&format=plain
&format=JSON

Call URL Examples

Overview of all IPv4 resource information in plain text:

https://lirportal.ripe.net/ipanalyser/v1/ipv4?key=9b86780d-5946-4126-99bb-ac5ad2c05d9a&format=plain

Overview of all IPv6 resource information in JSON format:

https://lirportal.ripe.net/ipanalyser/v1/ipv6?key=9b86780d-5946-4126-99bb-ac5ad2c05d9a&format=JSON