Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Azathothas/ip.ajam.dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

13 Commits

Repository files navigation

Note: You will need modern fonts to be able to view Flags

  • Specify --ipv4 | --ipv6 or similar for ipv4|ipv6 only data

Returns plain IPv4 | IPv6

curl -qfsSL "https://ip.ajam.dev"

Returns csv IPv4 | IPv6, GeoInfo & User-Agent

!#Using: curl + column
curl -qfsSL "https://ip.ajam.dev/csv" | column -ts ','
Example Response
ip city country flag region latitude longitude org timezone user-agent readme
18.227.3.14 Sao Paulo BR Sao Paulo -23.53350 -46.63590 Amazon.com America/Sao_Paulo curl/7.88.1 https://github.com/Azathothas/ip.ajam.dev

Returns HTML IPv4 | IPv6, GeoInfo & User-Agent

Example Response


Returns json IPv4 | IPv6, GeoInfo & User-Agent

!#Using: curl + https://github.com/jqlang/jq
curl -qfsSL "https://ip.ajam.dev/json" | jq '.'
Example Response
{
"ip": "18.227.3.14",
"city": "Sao Paulo",
"country": "BR",
"flag": "",
"region": "Sao Paulo",
"latitude": "-23.53350",
"longitude": "-46.63590",
"org": "Amazon.com",
"timezone": "America/Sao_Paulo",
"user-agent": "curl/7.88.1",
"readme": "https://github.com/Azathothas/ip.ajam.dev"
}

Returns text IPv4 | IPv6, GeoInfo & User-Agent

curl -qfsSL "https://ip.ajam.dev/text"
Example Response
ip=18.227.3.14
city=Sao Paulo
country=BR
flag=
region=Sao Paulo
latitude=-23.53350
longitude=-46.63590
org=Amazon.com
timezone=America/Sao_Paulo
user-agent=curl/7.88.1
readme=https://github.com/Azathothas/ip.ajam.dev

Returns xml IPv4 | IPv6, GeoInfo & User-Agent

!#Using: curl + https://github.com/sibprogrammer/xq
curl -qfsSL "https://ip.ajam.dev/xml" | xq
Example Response
xml version="1.0" encoding="UTF-8"?>
<data>
<ip>18.227.3.14ip>
<city>Sao Paulocity>
<country>BRcountry>
<flag>flag>
<region>Sao Pauloregion>
<latitude>-23.53350latitude>
<longitude>-46.63590longitude>
<org>Amazon.comorg>
<timezone>America/Sao_Paulotimezone>
<user-agent>curl/7.88.1user-agent>
<readme>https://github.com/Azathothas/ip.ajam.devreadme>
data>

Returns yaml IPv4 | IPv6, GeoInfo & User-Agent

!#Using: curl + https://github.com/mikefarah/yq
curl -qfsSL "https://ip.ajam.dev/yaml" | yq '.'
Example Response
ip: "18.227.3.14"
city: "Sao Paulo"
country: "BR"
flag: ""
region: "Sao Paulo"
latitude: "-23.53350"
longitude: "-46.63590"
org: "Amazon.com"
timezone: "America/Sao_Paulo"
user-agent: "curl/7.88.1"
readme: "https://github.com/Azathothas/ip.ajam.dev"

Deploy (Note to Self)

!# Install Wrangler: https://developers.cloudflare.com/workers/wrangler/install-and-update/
npm install "wrangler@latest" -g

!# Clone Source
git clone --filter="blob:none" "https://github.com/Azathothas/ip.ajam.dev"
cd "./ip.ajam.dev"
code "./ip.ajam.dev"

!# Deploy
npm install ; wrangler login
wrangler deploy

!# Dashboard >> Workers & Pages >> ip-api >> Settings >> Custom Domains >> Add: ip.ajam.dev

About

Simple Cloudflare Worker Config to return IP + GeoInfo in plain TEXT, CSV, JSON, XML & YAML

Topics

Resources

Readme

License

Unlicense license

Stars

Watchers

Forks

Contributors