package main import ( "fmt" "net/http" "io/ioutil" ) func main() { resp, _ := http.Get("https://api.ipquery.io/?format=json") body, _ := ioutil.ReadAll(resp.Body) fmt.Println(string(body)) }
From the IPQuery Docs