On 19/03/2023 01.58, Ehsan Ghazizadeh wrote:
I'm trying to write a python script to fetch bgp best path data for my prefixes from different locations. Apparently ripe stat only returns the full routing table not the best path, also connecting via telnet to routeviews routers and parsing bgp commands output is not an ideal method, so I was wondering is there any other method to achieve this (preferably using api)?
Why not use traceroutes from by atlas probes? RIPE Atlas has a scriptable API interface (required, you have the necessary RIPE Atlas credits! Alternatively, look into if hosting an Atlas Anchor might be of relevance for you use case) You can map the IP addresses to ASN's in the traceroute path. Source probes can be selected to be located in a specific source ASN, too. https://atlas.ripe.net/ https://atlas.ripe.net/landing/about/ https://labs.ripe.net/search/?type_of_content=articles&search_terms=RIPE+Atlas+Anchors&timeframe=any&sort_by=recent