API to Check IP Address Change. A Bit More Elegant.
TL; DR
A Smarter IP Change Detector
This is an free API by me. It allows you to check the change of your IP address, with a bit more elegance. And you are not letting go any privacy, too.
Here’s the usage:
where <IDENTIFIER>
is created by yourself. It can be any string between length 8, 32 (inclusive). When the API detects an <IDENTIFIER>
is accessed with a different IP than the previous one, it returns true
(text/plain). You should have guessed, <IDENTIFIER>
is supposed to be unique. Simple enough!
Example code:
Python (3, with requests):
Shell script (with curl):
Just want Plain IP Echo?
Simply use:
For more information on this IP Echo, see this post.
More Details
HTTP Method
All requests should be sent with GET
method.
Query Parameters Documentation
id
- Required. The key which IP change detection is based on. Length must be
>= 8
and<= 32
. On receiving requests, the server compares the source IP of request with the previous IP in the database associated with the sameid
. If they are different, returntrue
. If they are the same, returnfalse
. If there is no such key in the database, return<on_new_id>
(see below). Then the server updates the corresponding record in the database. Note thattrue
is returned only once when new IP is detected. - TTL: An
id
and its associated IP address will be removed from the database if there is no new request with it, after 1 week.
- Required. The key which IP change detection is based on. Length must be
on_new_id
- Optional. If present, the only value allowed for it is
true
. If not present, the server will take the default valuenew_id
. This value is returned to the client when the server sees a newid
which is not in the database.
- Optional. If present, the only value allowed for it is
The above are the available parameters for now.
Availability
This service is totally free… and it may disappear someday, if I really want it to disappear. Also, please do wait for some time between requests.
Privacy
This service is hosted by AWS Lambda, and DynamoDB is used for data storage. There is no log enabled. Identifiers and IP addresses in the database are hashed. No other data is stored. An item in the database looks like:
Source Code
Well… I thought for a while about this, because the code is… too simple.
Less than 60 lines!