You can consume nekoip from scripts, CI pipelines, or plain cURL calls. Below are the most common snippets.
Return only your public IP, suitable for shell scripts or diagnostics.
curl -s https://example.com/?format=txt
Request the JSON API and save the response into a file for further parsing.
curl -s -H "Accept: application/json" https://example.com/api/info > connection.json
Store the current egress IP during CI/CD to audit runners and egress routes.
curl -s https://example.com/?format=txt | tee artifacts/current_ip.txt
Call the API to retrieve resolver IPs detected by the browser widget. Replace TEST_ID with the identifier issued on the main page.
curl -s "https://example.com/api/dns-leak-test?id=TEST_ID"