API Usage
This section contains a list of 7 publicly available FREE web services that you can use. There is currently no usage restriction, but please be reasonable in making curl
calls, jQuery, Postman, Ajax or other API calls. Thank you.
List of web services:
- Get IP Address in text format
- Get IP Address in JSON format
- Get IP Address in JSONP
- Get IP Address in JSONP with custon callback
- Convert text to uppercase
- Convert text to lowercase
- Convert text to titlecase
1. Get IP Address in text format
This web service returns your IP address in text format.
URL: https://api.aruljohn.com/ip
PARAMETERS: none
RETURN TYPE: text
PARAMETERS: none
EXAMPLE:
curl https://api.aruljohn.com/ip
Alternative URL: https://ip.aruljohn.com
EXAMPLE:
curl https://ip.aruljohn.com/
OUTPUT:
199.199.199.199
2. Get IP Address in JSON format
This web service returns your IP address in JSON format.
URL: https://api.aruljohn.com/ip/json
PARAMETERS: none
RETURN TYPE: JSON
EXAMPLE:
curl https://api.aruljohn.com/ip/json
Alternative URL: https://ip.aruljohn.com/json
EXAMPLE:
curl https://ip.aruljohn.com/json
OUTPUT:
{"ip":"199.199.199.199"}
3. Get IP Address in JSONP
This web service returns your IP address in JSONP format.
URL: https://api.aruljohn.com/ip/jsonp
PARAMETERS: none
RETURN TYPE: JSON
EXAMPLE:
curl https://api.aruljohn.com/ip/jsonp
Alternative URL: https://ip.aruljohn.com/jsonp
EXAMPLE:
curl https://ip.aruljohn.com/jsonp
OUTPUT:
callback({"ip":"199.199.199.199"});
4. Get IP Address in JSONP with custon callback
This web service returns your IP address in JSONP format with a custom function name.
URL: https://api.aruljohn.com/ip/jsonp
PARAMETERS: callback=functionName
RETURN TYPE: JSON
EXAMPLE:
curl https://api.aruljohn.com/ip/jsonp?callback=findmyip
Alternative URL: https://ip.aruljohn.com/jsonp?callback=findmyip
EXAMPLE:
curl https://ip.aruljohn.com/jsonp?callback=findmyip
OUTPUT:
findmyip({"ip":"199.199.199.199"});
5. Convert text to uppercase
This web service returns a string with all the input converted to uppercase.
URL: https://api.aruljohn.com/uppercase
METHOD: POST
PARAMETERS: str
RETURN TYPE: text
EXAMPLE:
curl -X POST --data "str=hEllo tHEre" https://api.aruljohn.com/uppercase
OUTPUT:
HELLO THERE
6. Convert text to lowercase
This web service returns a string with all the input converted to lowercase.
URL: https://api.aruljohn.com/lowercase
METHOD: POST
PARAMETERS: str
RETURN TYPE: text
EXAMPLE:
curl -X POST --data "str=hEllo tHEre" https://api.aruljohn.com/lowercase
OUTPUT:
hello there
7. Convert text to titlecase
This web service returns a string with all the input converted to titlercase.
URL: https://api.aruljohn.com/titlecase
METHOD: POST
PARAMETERS: str
RETURN TYPE: text
EXAMPLE:
curl -X POST --data "str=hEllo tHEre" https://api.aruljohn.com/titlecase
OUTPUT:
Hello There
Finding IPv4 or IPv6 address
API Endpoint URL | Method | Sample Output (IPv4) | Sample Output (IPv6) |
---|---|---|---|
https://ip.aruljohn.com | GET | 123.123.123.123 | 0:0:0:0:0:ffff:7b7b:7b7b |
https://ip.aruljohn.com/json | GET | {"ip":"123.123.123.123"} | {"ip":"0:0:0:0:0:ffff:7b7b:7b7b"} |
https://ip.aruljohn.com/jsonp | GET | callback({"ip":"123.123.123.123"}); | callback({"ip":"0:0:0:0:0:ffff:7b7b:7b7b"}); |
https://ip.aruljohn.com/jsonp?callback=findmyip | GET | findmyip({"ip":"123.123.123.123"}); | findmyip({"ip":"0:0:0:0:0:ffff:7b7b:7b7b"}); |
Text format
To get the IP address in text format, run this curl command on the terminal.
curl https://ip.aruljohn.com
123.123.123.123
JSON format
To get the IP address in JSON format, run this curl command on the terminal.
curl https://ip.aruljohn.com/json
{"ip":"123.123.123.123"}
JSONP callback
To get the IP address with JSONP callback, thia is the endpoint.
curl https://ip.aruljohn.com/jsonp
The default output returns a function called callback()
.
curl https://ip.aruljohn.com/jsonp
callback({"ip":"123.123.123.123"});
JSONP callback with custom callback
To get the IP address with a specific JSONP callback, say findmyip
, this is the endpoint.
curl https://ip.aruljohn.com/jsonp?callback=findmyip
The default output returns a function called findmyip()
.
curl https://ip.aruljohn.com/jsonp?callback=findmyip
findmyip({"ip":"123.123.123.123"});
JSON format using jQuery
To get the IP address via Ajax call using jQuery, this code may be useful.
$(function() { $.ajax({ url: "https://ip.aruljohn.com/json", dataType: 'json', crossDomain: true, data: null, success: function (data, status, xhr) { $('#ip').html(data.ip); }, error: function(e, textStatus, errorMessage) { alert("ERROR" + e); }, }); });