Comprehensive cURL Commands for Every Developer
Discover an extensive collection of cURL commands designed to enhance your development workflow. From fetching your IP address in various formats to monitoring cryptocurrency exchange rates, and even keeping up with Covid-19 statistics, this cheatsheet is your go-to resource for efficient and powerful web operations.
Trace the redirect chain until the server runs out of lies
curl -Ls -o /dev/null -w "Final URL: %{url_effective}\nRedirects: %{num_redirects}\n" http://bit.ly/3G5Q1pA
Follow the first hop, expose the last - clean and ruthless
#!/usr/bin/env bash
while read -r url; do
redirects=0
next="$url"
first=""
final=""
while :; do
loc=$(curl -kIs -o /dev/null -w "%{redirect_url}" "$next")
[ -z "$loc" ] && break
redirects=$((redirects+1))
next="$loc"
# Spara första redirect-hoppet
[ -z "$first" ] && first="$loc"
# Uppdatera slutdestinationen
final="$loc"
done
# Skriv ut första redirect-hoppet (om det finns)
[ -n "$first" ] && echo "$first"
# Skriv ut slutdestinationen på samma rad med (Final Destination)
echo "${final:-$url} (Final Destination)"
echo "Total redirects: $redirects"
echo
done < <(cat <<EOF
http://tinyurl.com/2p9h4p6u
http://goo.gl/fbsS
http://is.gd/short
EOF
)
Measure latency like a network ninja’s whisper
curl -s -o /dev/null -w "DNS: %{time_namelookup}s | TCP: %{time_connect}s | TLS: %{time_appconnect}s | FirstByte: %{time_starttransfer}s | Total: %{time_total}s\n" http://192.168.1.1
"Silent full‑spectrum autopsy of an HTTP session"
curl -s -o /dev/null http://192.168.1.1 -w "\
-- ANSLUTNING --\n\
IP (Fjärr): %{remote_ip}\n\
Port (Fjärr): %{remote_port}\n\
IP (Lokal): %{local_ip}\n\
Port (Lokal): %{local_port}\n\
\n\
-- PRESTANDA (SEKUNDER) --\n\
DNS-uppslag: %{time_namelookup}s\n\
TCP-handskak: %{time_connect}s\n\
App-handskak: %{time_appconnect}s\n\
Pre-transfer: %{time_pretransfer}s\n\
Redirect-tid: %{time_redirect}s\n\
TTFB (Start): %{time_starttransfer}s\n\
TOTAL TID: %{time_total}s\n\
\n\
-- DATA & STATUS --\n\
Statuskod: %{http_code}\n\
HTTP-version: %{http_version}\n\
Antal Redirects: %{num_redirects}\n\
Storlek (Ned): %{size_download} bytes\n\
Hastighet (Ned): %{speed_download} bytes/s\n\
Header-storlek: %{size_header}\n\
Request-storlek: %{size_request}\n\
Effektiv URL: %{url_effective}\n"
Show me the headers — no small talk
curl -I https://www.linux-shell.se/
Print IP-Adrress (Inline)
curl l2.io/ip
curl https://echoip.de
curl ifconfig.me
curl ipecho.net/plain
curl -L ident.me
curl -L canihazip.com/s
curl -L tnx.nl/ip
curl wgetip.com
curl whatismyip.akamai.com
curl ip.tyk.nu
curl bot.whatismyipaddress.com
curl curlmyip.net
curl api.ipify.org
curl ipv4bot.whatismyipaddress.com
curl ipcalf.com
Print IP-Adrress (New LiNE)
curl ipaddy.net
curl eth0.me
curl ipaddr.site
curl ifconfig.co
curl ifconfig.pro
curl curlmyip.net
curl ipinfo.io/ip
curl icanhazip.com
curl checkip.amazonaws.com
curl smart-ip.net/myip
curl ip-api.com/line?fields=query
curl ifconfig.io/ip
curl -s ip.liquidweb.com
curl ifconfig.es
curl ipaddress.sh
curl 2ip.ru
Get cryptocurrencies exchange rates

curl rate.sx
Fetch etherum prices
curl rate.sx/eth
Covid-19
curl https://corona-stats.online
UNIX/Linux commands Cheatsheets using curl (chubin/cheat.sh)

curl cheat.sh
Subnet calculator
curl 'https://api.hackertarget.com/subnetcalc/?q=192.168.1.0/24'
Monitor server

curl ping.gl
Check status pages of common services

curl https://status.plaintext.sh/t
Title/URL of latest upload from indicated YouTube channel
curl -s "https://decapi.me/youtube/latest_video?user=NPR"
Last tweet from indicated account
curl -s "https://decapi.me/twitter/latest?name=NPR"
check if indicated twitch channel is online
curl -s "https://decapi.me/twitch/uptime?channel=IGN"
HTTP request and response Service (e.g. send response after 4 seconds)
curl -s "https://httpbin.org/delay/4" -
HTTP response defined in the request parameters
curl -s "https://urlecho.appspot.com/echo?body=Hello+World" -
HTTP proxy makes new requests based on input parameters
curl -s "https://urlreq.appspot.com/req?method=GET&url=https://l2.io/ip"
TCP port scan using NMAP
curl -s "https://api.hackertarget.com/nmap/?q=8.8.8.8"
Extract all links from a page
curl -s "https://api.hackertarget.com/pagelinks/?q=msn.com"
Whois lookup
curl -s "https://api.hackertarget.com/whois/?q=google.com"
Useful tool to retrieve fake api data
curl -s "https://jsonplaceholder.typicode.com/users"
Get weather
curl wttr.in
Get weather in Paris
curl wttr.in/Paris
Get help from wttr
curl wttr.in/:help
QR code generator
curl qrenco.de
QR code generator for the string "input
curl qrenco.de/input
Dictonary (e.g. search for the word "internet")
curl dict://dict.org/d:internet
Shorten url (e.g. shorten "https://youtube.com")
curl -F'shorten=https://youtube.com' https://0x0.st
Get the dancing parrot
curl parrot.live
generate a QR code in the terminal
echo https://www.gentoo.org/ | curl -F-=\<- qrenco.de
Find out the time spent between request and response
curl -v -o /dev/null -s -w 'Total: %{time_total}s\n' google.com
Find out the http status code of a URL
curl -s -o /dev/null -w "%{http_code}" https://www.example.net
Unshorten a shortended URL
curl -s -o /dev/null -w "%{redirect_url}" https://bit.ly/34EFwWC