David's API Endpoints
This site provides the documentation for a collection of simple Application Programming Interface (API) endpoints written by David, powered by AWS Lambda, and invoked through AWS API Gateway. Each endpoint runs cloud-hosted Python code and returns a JSON response.
Each endpoint can be called via the subdomain api.davidwilhelm.com
Available Endpoints
-
/hello
Returns a friendly greeting. Optionally accepts anameparameter.
Example:https://api.davidwilhelm.com/hello?name=David -
/subnet
Calculates subnet details of a given IP address (network address, broadcast address, usable hosts, etc.). Requires anipparameter and aprefixparameter.
Example:https://api.davidwilhelm.com/subnet?ip=10.0.0.100&prefix=24 -
/ping
Measures HTTP latency to a specified URL. Requires aURLparameter.
Example:https://api.davidwilhelm.com/ping?url=https://google.com -
/nslookup
Performs a DNS lookup for the specified hostname and returns all resolved IP addresses. Requires ahostparameter.
Example:https://api.davidwilhelm.com/nslookup?host=google.com -
/whoami
Returns the public IP address of the requester making the API call.
Example:https://api.davidwilhelm.com/whoami -
/asn-info
Returns the Autonomous System Number and organization details for either an IP address or an ASN value. Requires anipparameter or anasnparameter, but not both.
Example (IP lookup):https://api.davidwilhelm.com/asn-info?ip=8.8.8.8
Example (ASN lookup):https://api.davidwilhelm.com/asn-info?asn=15169 -
/hash
Generates an MD5 or SHA-256 hash from the provided text. Requires atextparameter and accepts an optionalalgorithmparameter (md5orsha256—default issha256).
Example (SHA-256):https://api.davidwilhelm.com/hash?text=HelloWorld&algorithm=sha256
Example (MD5):https://api.davidwilhelm.com/hash?text=HelloWorld&algorithm=md5 -
/password
Generates a random password of the specified length using letters, numbers, and special characters. Requires alengthparameter.
Example:https://api.davidwilhelm.com/password?length=16 -
/roll
Rolls one or more virtual dice with a specified number of sides. Accepts acountparameter and asidesparameter (default is 1 die with 6 sides).
Example:https://api.davidwilhelm.com/roll?count=3&sides=6 -
/port-scan
Performs a TCP port scan against a specified target using multi-threaded socket connections. Requires atargetparameter and aportsparameter. Theportsvalue may be a single port, a comma-separated list of ports, or a range of ports.
This endpoint requires an API key sent in thex-api-keyHTTP header to restrict access to authorized users only.
Example (range):https://api.davidwilhelm.com/port-scan?target=davidwilhelm.com&ports=1-100
Example (list):https://api.davidwilhelm.com/port-scan?target=davidwilhelm.com&ports=22,80,443
Each endpoint returns structured JSON and can be accessed directly in a browser, through
command-line tools such as curl, or from other scripts and applications.