You are here: Home > Analyse > Statistics > RIPEstat > Documentation > Interfaces & APIs > Text API

Please note that the RIPEstat Text API service has been put out of service. We encourage users to turn to the RIPEstat Data API and in case of command line requirements use jq. (June 2018)

What is the service?

The RIPEstat Text Service is a plaintext TCP service listening on port 43. You can connect to the service using standard tools or, if you prefer, you can download and install the Python code, which includes a command-line program with equivalent functionality.

The entire RIPEstat Text project is open source. Skilled users are encouraged to make and contribute enhancements via ripestat-text on GitHub so that the rest of the community, including users of the live service, can benefit.

Who is the service for?

The RIPEstat Text Service provides quick and useful information for network administrators, researchers and anyone else who is interested in a particular internet number resource, be it an IP prefix (or address) or an Autonomous System Number. It is a complement to the RIPEstat web interface, which presents the same information using rich visualizations and interactive navigation.

The service makes use of a semi-structured whois-style format, and offers a filtering mechanism for the RIPEstat data API to make it easy to integrate RIPEstat in your scripts.

How do I query the service?

The RIPEstat Text Service uses a simple line-based protocol which works with a number of text-based network clients, including whois, nc, ncat and telnet. Each line of input is structured like a unix command-line (without the program name), using options like -h and --help.

Note: Although the output format is in the style of whois, the service does not accept the same flags as a standard whois server. If you use a whois client, you need to make sure that flags are properly escaped so that they are sent to the server and not captured by your client. See the --help example below for a generally portable escaped command-line.

~$ whois -h as3333
% Results for 'as3333'
% You can see graphical visualizations at

as-overview:        AS3333
announced:          yes
description:        RIPE-NCC-AS - Reseaux IP Europeens Network Coordination Centre (RIPE NCC)
part-of:            AS1-65535: the 16-bit ASN Block
query-time:         2012-10-27T14:56:00 to 2012-10-30T14:56:00

geoloc:             AS3333
location:           100.0%  NL
query-time:         2012-10-01T00:00:00

registry-browser:     AS3333
type:               aut-num
as-name:            RIPE-NCC-AS
descr:              Reseaux IP Europeens Network Coordination Centre (RIPE NCC)
org:                ORG-RIEN1-RIPE
admin-c:            JDR-RIPE
admin-c:            BRD-RIPE
tech-c:             OPS4-RIPE
mnt-by:             RIPE-NCC-END-MNT
mnt-by:             RIPE-NCC-MNT
num-versions:       90
% The ref-by- fields show which objects refer to AS3333
ref-by-route6:      2001:67c:2e8::/48|AS3333

routing-status:     AS3333
ipv4-visibility:    100% of 91 peers
ipv6-visibility:    100% of 83 peers
first-seen:         before Jan 2001
announced-v4:       6 prefixes; 4608 IPs
announced-v6:       1 prefixes; 1 /48 equivalents
bgp-neighbours:     165
query-time:         2012-10-29T00:00:00

Or if you want to use netcat, the following is equivalent:

~$ echo as3333 | nc 43

You can also use the -k flag to get a persistent session, meaning that you can query for multiple resources. A second -k will kill the session:

~$ nc 43
... results for as123 ...
... results for as456 ...

To get a list of all available flags:

~$ whois -h " --help"   # note the space after the first quote!

or with netcat:

~$ echo --help | nc 43

To get a list of available widgets:

~$ whois -h " --list-widgets"

To get a list of available data calls:

~$ echo --list-data-calls | nc 43

Why does my favourite widget not output nicely?

At the moment, not every RIPEstat data call has a text widget. If you ask for a widget that doesn't exist in --list-widgets, but a data call with the same name exists, then a "best effort" output will be returned by converting the data API response to a whois-style format.

For example:

~$ whois -h " -w address-space-hierarchy 193/21"
% Results for '193/21'
% You can see graphical visualizations at

% 'address-space-hierarchy' doesn't have a command-line widget yet. Below is a direct translation of the data response.
% You can contribute a widget at
exact.0.status:               ASSIGNED PI
exact.0.descr:                RIPE Network Coordination Centre
Amsterdam, Netherlands              NL
exact.0.mnt-lower:            RIPE-NCC-MNT
exact.0.source:               RIPE               OPS4-RIPE
exact.0.netname:              RIPE-NCC
exact.0.remarks:              Used for RIPE NCC infrastructure.
exact.0.mnt-by:               RIPE-NCC-MNT
exact.0.admin-c:              JDR-RIPE
less_specific.0.status:       ALLOCATED PI
less_specific.0.descr:        Reseaux IP Europeens Network Coordination Centre (RIPE NCC)      NL          ORG-RIEN1-RIPE
less_specific.0.mnt-lower:    RIPE-NCC-MNT
less_specific.0.source:       RIPE       OPS4-RIPE
less_specific.0.mnt-routes:   RIPE-NCC-MNT
less_specific.0.netname:      NL-RIPENCC-OPS-990305
less_specific.0.remarks:      Amsterdam, Netherlands
less_specific.0.mnt-by:       RIPE-NCC-HM-MNT
less_specific.0.admin-c:      BRD-RIPE
rir:                          ripe
total_more_specific:          0
query-time:                   2012-11-06T00:00:00

If you would like to see a nicer output style for a particular widget then you can either request it or contribute one yourself.