chmey/py-iptoasn ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Python service that looks up an IP address and tells me its ASN details through a simple local web API.

I want to be able to run it, have it download the latest IP to ASN database from iptoasn.com, build whatever indexes it needs, and then serve a JSON response for a URL like /api/ip/1.1.1.1. The response should include the IP, ASN number, country code, description, and the start and end of the matching range.

Keep it lightweight and easy to run locally, since this is mainly for pentesting, incident response, or threat analysis. If it makes sense, include a basic example script so I can start it quickly, and make sure it also works nicely in Docker. If you need to check the current docs or best way to package it, feel free to look that up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab