API
RADb API Service
The Routing Assets Database (RADb) offers a comprehensive REST API for current customers, enabling programmatic access for querying and editing routing data. This API is designed for developers who need to interact with the RADb programmatically, whether to fetch routing objects, update data, or perform automated maintenance tasks.
Key Features
Instant Updates: Committed edits are typically reflected instantly.
Comprehensive Documentation: The API documentation can be accessed at:
RADb API DocumentationExample Code: The documentation provides example code in both curl (Linux terminal) and Python 3.7, showcasing every API function.
Supported API Operations
The RADb API supports a wide range of operations for various routing data objects. Here’s an overview:
Supported Object Types
as-set: Grouping of AS numbers
aut-num: Autonomous System number
filter-set: Filter expressions for routes
inet-rtr: Router interface details
mntner: Maintainer objects
peering-set: Peering arrangements
person: Individual contact information
role: Role account information
route: IPv4 route object
route6: IPv6 route object
route-set: Grouping of routes
rtr-set: Grouping of routers
Authentication
To access the API, authentication is required. Follow these steps:
Visit RADb API Documentation.
Click the "Authorize" button.
Under "BasicAuth", enter your RADb portal username and password, then click "Authorize".
Under "IRRPasswordAuth", enter your RADb maintainer password, then click "Authorize".
Close the authorization window.
Click GET/api/{source}/search.
Click "Try it out", then "Execute".
The generated authorization header will be displayed in the Curl section:
Authorization: Basic XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZ=Use this header for your API requests.
Example API Usage
GET
Search (Plain Text Format)
Retrieves routing objects by primary keys.
curl -X GET "https://api.radb.net/api/radb/search?query-string=MAINT-AS64505&inverse-attribute=mnt-by&password=MyPlaintextMntnerPassWrd" -H "accept: text/plain" -H "Authorization: Basic XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZ=="Search (JSON Format)
curl -X GET "https://api.radb.net/api/radb/search?query-string=MAINT-AS64505&inverse-attribute=mnt-by&password=MyPlaintextMntnerPassWrd" -H "accept: application/json" -H "Authorization: Basic XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZ=="Object (Plain Text Format)
curl -X GET "https://api.radb.net/api/radb/mntner/MAINT-AS64505?password=MyPlaintextMntnerPassWrd" -H "accept: text/plain" -H "Authorization: Basic XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZ=="POST
curl -X POST "https://api.radb.net/api/radb/aut-num?password=MyPlaintextMntnerPassWrd" -H "accept: text/plain" -H "Authorization: Basic XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZ==" -H "Content-Type: text/plain" -d '
aut-num: AS64505
as-name: ASTEST64505
descr: Testing RADb API for documentation
admin-c: DUMMY-RADB
tech-c: DUMMY-RADB
notify: someone@example.com
mnt-by: MAINT-AS64505
changed: someone@example.com 20190801
source: RADB
'
PUT
curl -X PUT "https://api.radb.net/api/radb/aut-num/AS64505?password=MyPlaintextMntnerPassWrd" -H "accept: text/plain" -H "Authorization: Basic XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZ==" -H "Content-Type: text/plain" -d
'
aut-num: AS64505
as-name: ASTEST64505
descr: Testing RADb API for documentation updated2
admin-c: DUMMY-RADB
tech-c: DUMMY-RADB
notify: someone@example.com
mnt-by: MAINT-AS64505
changed: someone@example.com 20190801
source: RADB
'
DELETE
curl -X DELETE "https://api.radb.net/api/radb/aut-num/AS64505?password=MyPlaintextMntnerPassWrd" -H "accept: text/plain" -H "Authorization: Basic XYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZXYZ==" -H "Content-Type: text/plain" -d
'
aut-num: AS64505
as-name: ASTEST64505
descr: Testing RADb API for documentation updated2
admin-c: DUMMY-RADB
tech-c: DUMMY-RADB
notify: someone@example.com
mnt-by: MAINT-AS64505
changed: someone@example.com 20190801
source: RADB
delete: contact@example.com reasons
'Python
Here are some example script files written in Python that you can use to help develop your codebase.
Example Script
Helper functions
This python code includes some function definitions which can extract and modify attributes of RPSL objects.
Best Practices
Efficient Use: Copy and paste the entire curl command, including newlines if applicable, and modify as needed.
Error Handling: Implement retry and back-off routines in case of failed connections or timeouts.
Security: Never expose your maintainer password in public scripts or repositories.
Rate Limits: Avoid overloading the API with high-traffic, automated queries.
By following these guidelines and leveraging the RADb API effectively, developers can efficiently manage routing data while minimizing service disruptions.
Please contact RADb Support for Assistance at support@radb.net or (734) 527-5776.