#!/usr/bin/env bash url='http://web.archive.org/cdx/search/cdx?output=json' for arg in "$@"; do url+="&${arg%%=*}=$(printf '%s' "${arg#*=}"|urlencode)" done curl -s "$url"