I have a small API to get the source ASN for IPs [0] that also does bulk exports of all announced subnets by an ASN [1]. Feel free to use it in your scripts there are no rate limits although it's not super performant so please don't do more than like 10 concurrent requests.
[0] https://asnumber.tuxli.ch/asnumber/asnum?ip=2001:67c:99c::1