import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Random;

HttpRequest request = HttpRequest.newBuilder()
		.uri(URI.create("https://wft-geo-db.p.rapidapi.com/v1/geo/adminDivisions"))
		.header("X-RapidAPI-Key", "9d1b75d842msh20486d8bf8d5c19p1904abjsneb2943a9124c")
		.header("X-RapidAPI-Host", "wft-geo-db.p.rapidapi.com")
		.method("GET", HttpRequest.BodyPublishers.noBody())
		.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
{"data":[{"id":3515514,"wikiDataId":"Q4117373","name":"Al Mamzar","country":"United Arab Emirates","countryCode":"AE","region":"Dubai","regionCode":"DU","latitude":25.309469444,"longitude":55.342811111,"population":0},{"id":3386644,"wikiDataId":"Q3694483","name":"Ab Band District","country":"Afghanistan","countryCode":"AF","region":"Ghazni","regionCode":"GHA","latitude":32.983,"longitude":67.967,"population":0},{"id":3339608,"wikiDataId":"Q2572213","name":"Ab Kamari","country":"Afghanistan","countryCode":"AF","region":"Badghis","regionCode":"BDG","latitude":34.925,"longitude":62.901666666,"population":0},{"id":3228129,"wikiDataId":"Q1650529","name":"Achin","country":"Afghanistan","countryCode":"AF","region":"Nangarhar","regionCode":"NAN","latitude":34.0894,"longitude":70.683,"population":0},{"id":3301438,"wikiDataId":"Q2714271","name":"Adraskan District","country":"Afghanistan","countryCode":"AF","region":"Herat","regionCode":"HER","latitude":33.705277777,"longitude":61.995555555,"population":0}],"links":[{"rel":"first","href":"/v1/geo/cities?offset=0&limit=5"},{"rel":"next","href":"/v1/geo/cities?offset=5&limit=5"},{"rel":"last","href":"/v1/geo/cities?offset=71985&limit=5"}],"metadata":{"currentOffset":0,"totalCount":71986}}