Step-by-Step Guide:
Manage and Resource Analytics API
Discover the power of our API by obtaining an enriched view of discovered resources - just one of the many ways you can leverage our API to enhance your data insights.
All operations in this context utilize the Nethub API.
Before using the API, please make sure to complete API Authorization
1. Retrieve a list of discovered IPv4 and IPv6 resources with their enriched data
Request
BASH
curl 'https://apigw.ipxo.com/nethub-data/c4a84238-3a89-43f0-8a83-8d5edc9c8c65/prefixes/search' \
-X 'POST' \
-H 'Authorization: Bearer jZwuDUdni6eObyTiYBzzee5mRw9SSi57l0SV0ernFKU.IDcqN8Tf1ASO6McPiVYWllCzcbY27OAIRi3vuKjYoxs' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{}'
Note
In case you have a large organization, we recommend using "limit" attribute to limit amount of objects to return, for example "limit": 2 will retunf only 2 objects, that way you will see how the data looks like and will be able to filter only interesting data.
In your bash request update "-d " field like this: -d '{"limit": 2}'
Response
JSON
{"data": [
{
"notation": "185.139.0.0/22",
"ipNet": {
"IP": "185.139.0.0",
"Mask": "///8AA=="
},
"maskSize": 22,
"internalMetadata": {
"internal": false,
"readOnly": false,
"master": true,
"prefixLengthLimits": {
"min": 0,
"max": 0,
"exact": null
},
"holder": {
"tenantUUID": "c4a84238-3a89-43f0-8a83-8d5edc9c8c65",
"projectID": "",
"organisation": "ORG-CAF4-RIPE"
}
},
"geodata": [
{
"provider": "dbip",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt am Main",
"date": "2023-09-01T00:17:27Z"
},
{
"provider": "ip2location",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt am Main",
"date": "2023-09-01T00:00:00Z",
"state": "Hessen"
},
{
"provider": "ipgeolocation",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt",
"date": "2023-09-25T02:57:21Z",
"state": "Hesse"
},
{
"provider": "ipinfo",
"countryName": "DE",
"countryCode": "DE",
"cityName": "Frankfurt am Main",
"date": "2023-09-27T08:16:03Z"
},
{
"provider": "ipregistry",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt",
"date": "2023-09-27T18:40:10Z",
"state": "DE-HE"
},
{
"provider": "maxmind",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt am Main",
"date": "2023-09-25T17:44:47Z"
}
],
"whois": {
"inetnum": "185.139.0.0/22",
"registrar": "ripencc",
"netname": "AE-CYBERASSETS-20160216",
"description": "",
"country": "AE",
"admin_c": "DUMY-RIPE",
"tech_c": "DUMY-RIPE",
"status": "ALLOCATED PA",
"source": "RIPE",
"notify": "",
"organisation": "ORG-CAF4-RIPE",
"irt": "",
"created": "2021-10-22T11:24:43Z",
"last_modified": "2023-04-20T10:58:42Z",
"record_created": "2023-07-18T11:21:20Z",
"record_modified": "2023-08-15T17:32:03Z",
"record_active": true,
"mnt_by": [
"RIPE-NCC-HM-MNT",
"CYBER-A-MNT"
],
"domains": [
{
"domain": "0.139.185.in-addr.arpa",
"nservers": [
"ns10.host1plus.com",
"ns8.host1plus.com",
"ns9.host1plus.com"
]
},
{
"domain": "1.139.185.in-addr.arpa",
"nservers": [
"ns10.host1plus.com",
"ns8.host1plus.com",
"ns9.host1plus.com"
]
},
{
"domain": "2.139.185.in-addr.arpa",
"nservers": [
"ns10.host1plus.com",
"ns8.host1plus.com",
"ns9.host1plus.com"
]
}
]
}
}
],
"metadata": {
"limit": 1,
"offset": 0
}
2. Use FIELDS attribute to filter your response
Fields attribute is your key attribute when you want to simply your response data, in below example we will filter that we are only interested in Geolocation metadata (object = geodata).
You can also use subobject types (object.subobject) like whois.inetnum or routes.origin.
Request
BASH
curl 'https://apigw.ipxo.com/nethub-data/c4a84238-3a89-43f0-8a83-8d5edc9c8c65/prefixes/search' \
-X 'POST' \
-H 'Authorization: Bearer jZwuDUdni6eObyTiYBzzee5mRw9SSi57l0SV0ernFKU.IDcqN8Tf1ASO6McPiVYWllCzcbY27OAIRi3vuKjYoxs' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"fields": ["geodata"], "limit": 1}'
Response
JSON
{"data": [
{
"notation": "185.139.0.0/22",
"geodata": [
{
"provider": "dbip",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt am Main",
"date": "2023-09-01T00:17:27Z"
},
{
"provider": "ip2location",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt am Main",
"date": "2023-09-01T00:00:00Z",
"state": "Hessen"
},
{
"provider": "ipgeolocation",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt",
"date": "2023-09-25T02:57:21Z",
"state": "Hesse"
},
{
"provider": "ipinfo",
"countryName": "DE",
"countryCode": "DE",
"cityName": "Frankfurt am Main",
"date": "2023-09-27T08:16:03Z"
},
{
"provider": "ipregistry",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt",
"date": "2023-09-27T18:40:10Z",
"state": "DE-HE"
},
{
"provider": "maxmind",
"countryName": "Germany",
"countryCode": "DE",
"cityName": "Frankfurt am Main",
"date": "2023-09-25T17:44:47Z"
}
]
}
],
"metadata": {
"limit": 1,
"offset": 0
}
3. Check your not announced prefixes
After resource discovery is completed and organizations validated IPXO provides overview graphs per different systems, most of them can be checked in details using above APIs, but graphs like Resource Utilization are calculated via our Resource Analytics tool and can come very handy when you quickly need to check what parts of resources are not in use.
Request
BASH
curl -X POST "https://apigw.ipxo.com/nethub-analytics/c4a84238-3a89-43f0-8a83-8d5edc9c8c65/aggregates/search/unannounced" \
--header 'Authorization: Bearer jZwuDUdni6eObyTiYBzzee5mRw9SSi57l0SV0ernFKU.IDcqN8Tf1ASO6McPiVYWllCzcbY27OAIRi3vuKjYoxs' \
--data '{}'
Response
JSON
{"data": [
{
"notation": "5.252.72.0/24",
"tenant_uuid": "c4a84238-3a89-43f0-8a83-8d5edc9c8c65",
"organisation": "ORG-CAF4-RIPE",
"isMaster": false,
"lastSeen": "2023-09-29T12:44:45.374Z"
}
],
"metadata": {
"limit": 1,
"offset": 0
}
}
4. Prepared API presets
Below you will find some most common API presets, so just add your TenandUUID and API Key to use them!
Available option (conditions, "op" field) while building your API queries
Most common "op" field is "eq" that stand for equal, but there are others, like "and", "gt", "gte", "lt", "lte", "ne" - use them to create complex queries!
Get necessary Routing data
Request
BASH
curl 'https://apigw.ipxo.com/nethub-data/c4a84238-3a89-43f0-8a83-8d5edc9c8c65/prefixes/search' \
-X 'POST' \
-H 'Authorization: Bearer jZwuDUdni6eObyTiYBzzee5mRw9SSi57l0SV0ernFKU.IDcqN8Tf1ASO6McPiVYWllCzcbY27OAIRi3vuKjYoxs' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"fields": ["bgp", "rpki", "routes.route", "routes.origin", "routes.source"], "limit": 1}'
Get Only Whois fields: Organisation, Country, Mnt-by
Request
BASH
curl 'https://apigw.ipxo.com/nethub-data/c4a84238-3a89-43f0-8a83-8d5edc9c8c65/prefixes/search' \
-X 'POST' \
-H 'Authorization: Bearer jZwuDUdni6eObyTiYBzzee5mRw9SSi57l0SV0ernFKU.IDcqN8Tf1ASO6McPiVYWllCzcbY27OAIRi3vuKjYoxs' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"fields": ["whois.inetnum", "whois.organisation", "whois.country", "whois.mnt_by"], "limit": 1}'.
Get Prefixes that have Geolocation country US and Whois country US
Request
BASH
curl 'https://apigw.ipxo.com/nethub-data/c4a84238-3a89-43f0-8a83-8d5edc9c8c65/prefixes/search' \
-X 'POST' \
-H 'Authorization: Bearer jZwuDUdni6eObyTiYBzzee5mRw9SSi57l0SV0ernFKU.IDcqN8Tf1ASO6McPiVYWllCzcbY27OAIRi3vuKjYoxs' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"geodata": {"field": "countryCode", "op": "eq", "vals": ["US"]}, "whois": {"field": "country", "op": "eq", "vals": ["US"]},"fields": ["whois.country", "geodata.provider", "geodata.countryCode"]}'
For any inquiries or feedback, please feel free to reach out to us.