Origin

Origin #

The origin handler will return the current source ASN for the IP requested.

Always check the status_code is 200 after each query.
exists will only be true if a live route exists for the queried prefix. If there is no live prefix, the HTTP status code will still be 200.

c = bgpstuff.Client()

c.get_origin("1.1.1.1")
if c.status_code == 200 and c.exists:
    print(f"The origin for 1.1.1.1 is AS{c.origin}")
The origin for 1.1.1.1 is AS13335
TODO