# BGP State


This data call returns the state of BGP routes for a resource at a certain point in time, as observed by all the RIS collectors.
This is derived by applying a computation of state to the RIB dump (granularity=8h) that occurred exactly before that time, using the BGP updates observed between the RIB time and the query time.

GET /data/bgp-state/data.json?resource=140.78/16&timestamp=2020-12-21T12:00

# Parameters

Key Value Info Required
resource Prefix, IP address, AS or a list of valid comma-separated resources Defines the resource that the query is performed for. If a list of resources is supplied, the results will be combined for all of them. YES
timestamp ISO8601 or Unix timestamp Defines the time for when to perform the query. NO - default: latest time there is BGP data available
rrcs Single-value or comma-separated values of RRC numbers (4 or 0,4,12,15) The list of Route Collectors (RRCs) to get the results from. NO - default behaviour: all RRCs
unix_timestamps TRUE or FALSE If TRUE, will format the timestamps in the result as Unix timestamp. NO - default: FALSE

# Data Output

Key Info
bgp_state List of BGP routes.
target_prefix Prefix to which this BGP route refers to.
path The AS path in this BGP route, formatted as a list of ASes (first element is the direct BGP neighbour, last element is the origin AS).
community The list of communities in this BGP route.
source_id The id of the route collector (rrc) neighbouring peer through which this BGP route was observed. The format is "[rrc number]-[peer IP address]".
nr_routes The number of BGP routes observed at that time.
time Defines the time of the query.
timestamp Defines the time for which the query is perfomed.
resource Defines the resource used in the query.

# Code Examples

Last Updated: Wednesday, 17 August 2022