Dowell Coordinates API

Wherever you’re headed, Dowell Coordinates API ensures you arrive with accuracy

Dowell Payments API Definition

Dowell
Coordinates API

The Dowell Coordinates API is a handy tool designed to help you find precise geographic coordinates for any location you need. Whether it’s a city, a region, or even a specific address, this API has got you covered. With just a simple input of the location’s name, like New Delhi, Nairobi, or New York, you can get the latitude and longitude information you need. This makes it super easy to integrate location-based data into your applications.

How to Use

Using the Dowell Coordinates API is a breeze! Here’s a quick overview of the available endpoints. For more detailed information on each endpoint and how to use them, you can find the complete endpoint list and documentation in the Postman documentation mentioned in Get Started Section.

1. Get Coordinates

Use this endpoint to obtain the coordinates for a specific location. Simply provide the name of the location, and the API will return its latitude and longitude.

2. Get Regions

This endpoint allows you to retrieve regions based on certain criteria. Perfect for when you need to gather information about different geographical areas.

3. Get Countries V3

Need information about a specific country? This endpoint has you covered. Provide the country name, and get all the details you need.

4. Get All Country Regions V3 

This endpoint provides information about all the regions within a specific country. Useful for applications requiring detailed geographical data.

5. Get Custom Region Coords V3

If you have a custom region in mind and need its coordinates, this endpoint is what you need. Simply input the region’s details, and get the coordinates hassle-free.

6. Get Regions by Substring

Looking for regions that match a certain substring? This endpoint will help you find what you need quickly and efficiently.

Benefits of Using the Dowell Coordinates API

  • Precision: Get accurate latitude and longitude coordinates for any location.
  • Ease of Integration: Seamlessly integrate location-based data into your applications.
  • Wide Applicability: Suitable for a variety of software projects and services.
  • User-Friendly: Simple to implement with detailed technical specifications and usage guidelines.
Dowell Coordinates API

Postman Documentation

For detailed API documentation, including endpoint descriptions, request and response examples, and authentication details, please refer to the API documentation

Dowell Coordinates API Demonstrative Scenarios

In the following scenarios, Dowell will furnish comprehensive instructions on obtaining the Service key and guide you through the steps to use the API. You’ll find examples in various formats such as Python, PHP, React, Flutter, and WordPress in the tabs below. Feel free to explore the examples in each tab for practical insights.

Dowell Coordinates API Use Cases

Dive into Dowell’s Coordinates API and discover how it’s revolutionizing industries! Explore how it enhances real estate listings, connects friends on social networks, optimizes logistics routes, and aids emergency responders. Watch our videos for captivating examples and unleash the power of location-based solutions today!

Frequently Asked Questions (FAQs) about Dowell Coordinates API

You can obtain precise geographic coordinates for various locations, including cities, regions, specific addresses, landmarks, and more.

The API returns latitude and longitude coordinates in decimal format.

Yes, you need to include your API key in the request parameters to authenticate and access the API endpoints.

You can use the “Get Countries V3” endpoint to retrieve a list of countries. Simply make a POST request to the specified endpoint with your API key.

Yes, you can use the “Get All Country Regions V3” endpoint to retrieve details about all regions within a specified country.

If you encounter any issues, have questions, or need assistance with Dowell Coordinates API, you can contact the support team for prompt assistance. Contact us at Dowell@dowellresearch.uk 

Yes, you can integrate the API with various platforms and programming languages including Python, PHP, React, Flutter, and WordPress. We provide examples in each of these formats for easy integration.

The Dowell database is regularly updated with new location information to ensure accuracy and relevance.

Yes, you can use the Dowell Coordinates API for both personal and commercial purposes after obtaining the necessary API key and adhering to our terms of service.

Dowell UX Living Lab offers a wide range of APIs to enhance user experience and streamline various processes. To explore the full list of APIs available, including Dowell Email, Dowell Newsletter, Samanta Content Evaluator, and many more.

For more details and to explore the complete list of APIs provided by Dowell UX Living Lab, please visit our documentation page.

How To Get The API Key

Activate Dowell Coordinates

Python Example

1. How to Get Coordinates

This code retrieves coordinates for the specified region (Nairobi) by sending a POST request to the given URL with the region name and API key as parameters. Make sure to replace ‘your_api_key’ with your actual API key before running the code

				
					import requests

# Replace 'your_api_key' with your actual API key
api_key = 'your_api_key'
url = 'https://100074.pythonanywhere.com/get-coords/'

# Prepare the payload with the region name and API key
payload = {
    "region": "Nairobi",  # Specify the region you want to get coordinates for
    "api_key": api_key    # Provide your API key for authentication
}

# Send a POST request to the API endpoint with the payload
response = requests.post(url, json=payload)

# Print the JSON response from the API
print(response.json())

				
			

2. How to Get Regions

This Python code fetches information about regions by sending a GET request to a specific URL. It includes an API key as a parameter in the request to authenticate the user. Once the response is received from the API, it is printed in JSON format for further processing.

				
					import requests

# Replace 'your_api_key' with your actual API key
api_key = 'your_api_key'

# The URL of the API endpoint
url = 'https://100074.pythonanywhere.com/regions/'

# Parameters to be sent with the request, including the API key
params = {"api_key": api_key}

# Send a GET request to the API endpoint with the specified parameters
response = requests.get(url, params=params)

# Print the JSON response from the API
print(response.json())

				
			

3. How to Get Countries

This Python code retrieves information about all the countries stored in the database. It does this by sending a request to a specific URL using the POST method. The API key is included as a parameter in the request to authenticate the user. Once the request is sent, the code prints out the response received from the API in JSON format.

				
					import requests

# Replace 'your_api_key' with your actual API key
api_key = 'your_api_key'

# Define the URL for the API endpoint
url = 'https://100074.pythonanywhere.com/get-countries-v3/'

# Set parameters for the POST request, including the API key
params = {"api_key": api_key}

# Send a POST request to the URL with the specified parameters
response = requests.post(url, params=params)

# Print the JSON response from the API
print(response.json())

				
			

4. How to Get All Country Regions

This Python code sends a request to an API endpoint to retrieve all regions for a specific country (Italy). Make sure to replace 'your_api_key' with your actual API key. The request is sent using the requests library, with the URL of the API endpoint, parameters, and payload. Once the response is received, it prints the JSON data returned by the API.

				
					import requests

# Replace 'your_api_key' with your actual API key
api_key = 'your_api_key'

# URL of the API endpoint
url = 'https://100074.pythonanywhere.com/get-coords-v3/'

# Parameters for the request
params = {"api_key": api_key}

# Data payload for the request
payload = {
    "country": "italy",  # Specify the country whose regions you want to retrieve
    "query": "all"       # Specify 'all' to get all regions
}

# Send a POST request to the API endpoint with the provided parameters and payload
response = requests.post(url, params=params, json=payload)

# Print the JSON response from the API
print(response.json())

				
			

5. How to Get Custom Country Region Coordinates

This code sends a request to an API endpoint to retrieve details for specific regions (Rome and Abano Terme) of a particular country (Italy). It includes your API key for authentication. After preparing the necessary parameters and payload, the code sends a POST request to the provided URL with the country name, query parameter, and a list of regions. Finally, it prints the JSON response received from the API.

				
					import requests

# Replace 'your_api_key' with your actual API key
api_key = 'your_api_key'
url = 'https://100074.pythonanywhere.com/get-coords-v3/'

# Parameters for the API request
params = {"api_key": api_key}

# Payload containing the country name and regions
payload = {
    "country": "italy",
    "query": "custom",
    "regionList": ["Rome", "Abano Terme"]
}

# Sending a POST request to the API endpoint
response = requests.post(url, params=params, json=payload)

# Printing the JSON response
print(response.json())

				
			

6. How to Get Regions by Substring

This endpoint helps you find regions in a country that have a certain word or letters in their names. For example, if you’re looking for regions in Italy with names containing “Ab”, you can use this. Just send a POST request to the given URL with the country name and the substring you’re interested in. Then, you’ll get back information about matching regions.

				
					import requests

# Replace 'your_api_key' with your actual API key
api_key = 'your_api_key'
url = 'https://100074.pythonanywhere.com/get-coords-v4/'

# Parameters for the API request
params = {"api_key": api_key}

# Payload containing the country name, query type, and substring
payload = [{
    "country": "italy",
    "query": "all",
    "subStr": "Ab"
}]

# Sending a POST request to the API endpoint
response = requests.post(url, params=params, json=payload)

# Printing the JSON response
print(response.json())

				
			

PHP Example

1. How to Get Coordinates

This PHP code retrieves coordinates for a specified region (Nairobi) by sending a POST request to the provided URL with the region name and API key as parameters.

				
					<?php
// Replace 'your_api_key' with your actual API key
$api_key = 'your_api_key';
$url = 'https://100074.pythonanywhere.com/get-coords/';

// Prepare the payload with the region name and API key
$payload = array(
    "region" => "Nairobi",  // Specify the region you want to get coordinates for
    "api_key" => $api_key   // Provide your API key for authentication
);

// Send a POST request to the API endpoint with the payload
$response = file_get_contents($url, false, stream_context_create(array(
    'http' => array(
        'method' => 'POST',
        'header' => 'Content-Type: application/json',
        'content' => json_encode($payload)
    )
)));

// Print the JSON response from the API
echo $response;
?>

				
			

2. How to Get Regions

This PHP code fetches information about regions by sending a GET request to a specific URL. It includes an API key as a parameter for authentication.

				
					<?php
// Replace 'your_api_key' with your actual API key
$api_key = 'your_api_key';
$url = 'https://100074.pythonanywhere.com/regions/';

// Send a GET request to the API endpoint with the specified API key
$response = file_get_contents($url . '?api_key=' . $api_key);

// Print the JSON response from the API
echo $response;
?>

				
			

3. How to Get Countries

This PHP code retrieves information about all countries stored in the database by sending a POST request to a specific URL.

				
					<?php
// Replace 'your_api_key' with your actual API key
$api_key = 'your_api_key';
$url = 'https://100074.pythonanywhere.com/get-countries-v3/';

// Set parameters for the POST request, including the API key
$params = array("api_key" => $api_key);

// Send a POST request to the URL with the specified parameters
$response = file_get_contents($url, false, stream_context_create(array(
    'http' => array(
        'method' => 'POST',
        'header' => 'Content-Type: application/json',
        'content' => json_encode($params)
    )
)));

// Print the JSON response from the API
echo $response;
?>

				
			

4. How to Get All Country Regions

This PHP code sends a request to an API endpoint to retrieve all regions for a specific country (Italy).

				
					<?php
// Replace 'your_api_key' with your actual API key
$api_key = 'your_api_key';
$url = 'https://100074.pythonanywhere.com/get-coords-v3/';

// Parameters for the request
$params = array("api_key" => $api_key);

// Data payload for the request
$payload = array(
    "country" => "italy",  // Specify the country whose regions you want to retrieve
    "query" => "all"       // Specify 'all' to get all regions
);

// Send a POST request to the API endpoint with the provided parameters and payload
$response = file_get_contents($url, false, stream_context_create(array(
    'http' => array(
        'method' => 'POST',
        'header' => 'Content-Type: application/json',
        'content' => json_encode($payload)
    )
)));

// Print the JSON response from the API
echo $response;
?>

				
			

5. How to Get Custom Country Region Coordinates

This PHP code sends a request to an API endpoint to retrieve details for specific regions (Rome and Abano Terme) of Italy.

				
					<?php
// Replace 'your_api_key' with your actual API key
$api_key = 'your_api_key';
$url = 'https://100074.pythonanywhere.com/get-coords-v3/';

// Parameters for the API request
$params = array("api_key" => $api_key);

// Payload containing the country name and regions
$payload = array(
    "country" => "italy",
    "query" => "custom",
    "regionList" => array("Rome", "Abano Terme")
);

// Sending a POST request to the API endpoint
$response = file_get_contents($url, false, stream_context_create(array(
    'http' => array(
        'method' => 'POST',
        'header' => 'Content-Type: application/json',
        'content' => json_encode($payload)
    )
)));

// Printing the JSON response
echo $response;
?>

				
			

6. How to Get Regions by Substring

This endpoint helps you find regions in a country that have a certain word or letters in their names. For example, if you’re looking for regions in Italy with names containing “Ab”, you can use this.

				
					<?php
// Replace 'your_api_key' with your actual API key
$api_key = 'your_api_key';
$url = 'https://100074.pythonanywhere.com/get-coords-v4/';

// Parameters for the API request
$params = array("api_key" => $api_key);

// Payload containing the country name, query type, and substring
$payload = array(
    array(
        "country" => "italy",
        "query" => "all",
        "subStr" => "Ab"
    )
);

// Sending a POST request to the API endpoint
$response = file_get_contents($url, false, stream_context_create(array(
    'http' => array(
        'method' => 'POST',
        'header' => 'Content-Type: application/json',
        'content' => json_encode($payload)
    )
)));

// Printing the JSON response
echo $response;
?>

				
			

React Example

1. How to Get Coordinates

This React component fetches coordinates for a specified region (in this case, Nairobi) by sending a POST request to the API endpoint with the region name and API key as parameters.

				
					import React, { useState, useEffect } from 'react';
import axios from 'axios';

// Component for fetching coordinates for a specified region
const GetCoordinates = () => {
    // State to hold the coordinates
    const [coordinates, setCoordinates] = useState(null);

    useEffect(() => {
        // Function to fetch coordinates
        const fetchCoordinates = async () => {
            try {
                // Replace 'your_api_key' with your actual API key
                const api_key = 'your_api_key';

                // URL for the API endpoint
                const url = 'https://100074.pythonanywhere.com/get-coords/';

                // Payload with the region name and API key
                const payload = {
                    region: 'Nairobi',
                    api_key: api_key
                };

                // Sending a POST request to the API endpoint
                const response = await axios.post(url, payload);

                // Set the coordinates state with the response data
                setCoordinates(response.data);
            } catch (error) {
                console.error('Error fetching coordinates:', error);
            }
        };

        // Call the fetchCoordinates function
        fetchCoordinates();
    }, []);

    return (
        <div>
            {/* Displaying the coordinates */}
            {coordinates && (
                <p>Coordinates: {coordinates.latitude}, {coordinates.longitude}</p>
            )}
        </div>
    );
};

export default GetCoordinates;

				
			

2. How to Get Regions

This React component fetches information about regions by sending a GET request to the API endpoint. It includes an API key as a parameter to authenticate the user.

				
					import React, { useState, useEffect } from 'react';
import axios from 'axios';

// Component for fetching regions
const GetRegions = () => {
    // State to hold the regions
    const [regions, setRegions] = useState(null);

    useEffect(() => {
        // Function to fetch regions
        const fetchRegions = async () => {
            try {
                // Replace 'your_api_key' with your actual API key
                const api_key = 'your_api_key';

                // URL for the API endpoint
                const url = 'https://100074.pythonanywhere.com/regions/';

                // Parameters to be sent with the request
                const params = { api_key: api_key };

                // Sending a GET request to the API endpoint
                const response = await axios.get(url, { params });

                // Set the regions state with the response data
                setRegions(response.data);
            } catch (error) {
                console.error('Error fetching regions:', error);
            }
        };

        // Call the fetchRegions function
        fetchRegions();
    }, []);

    return (
        <div>
            {/* Displaying the regions */}
            {regions && (
                <ul>
                    {regions.map(region => (
                        <li key={region}>{region}</li>
                    ))}
                </ul>
            )}
        </div>
    );
};

export default GetRegions;

				
			

3. How to Get Countries

This React component fetches information about all countries stored in the database by sending a request to the provided API endpoint using the POST method. The API key is included as a parameter in the request for authentication.

				
					import React, { useState, useEffect } from 'react';
import axios from 'axios';

// Component for fetching countries
const GetCountries = () => {
    // State to hold the countries
    const [countries, setCountries] = useState(null);

    useEffect(() => {
        // Function to fetch countries
        const fetchCountries = async () => {
            try {
                // Replace 'your_api_key' with your actual API key
                const api_key = 'your_api_key';

                // URL for the API endpoint
                const url = 'https://100074.pythonanywhere.com/get-countries-v3/';

                // Parameters to be sent with the request
                const params = { api_key: api_key };

                // Sending a POST request to the API endpoint
                const response = await axios.post(url, null, { params });

                // Set the countries state with the response data
                setCountries(response.data);
            } catch (error) {
                console.error('Error fetching countries:', error);
            }
        };

        // Call the fetchCountries function
        fetchCountries();
    }, []);

    return (
        <div>
            {/* Displaying the countries */}
            {countries && (
                <ul>
                    {countries.map(country => (
                        <li key={country}>{country}</li>
                    ))}
                </ul>
            )}
        </div>
    );
};

export default GetCountries;

				
			

4. How to Get All Country Regions

This React component sends a request to an API endpoint to retrieve all regions for a specific country (in this case, Italy). The API key is included for authentication. Once the response is received, it prints the JSON data returned by the API.

				
					import React, { useState, useEffect } from 'react';
import axios from 'axios';

// Component for fetching all regions of a country
const GetAllCountryRegions = () => {
    // State to hold the regions
    const [regions, setRegions] = useState(null);

    useEffect(() => {
        // Function to fetch regions
        const fetchRegions = async () => {
            try {
                // Replace 'your_api_key' with your actual API key
                const api_key = 'your_api_key';

                // URL for the API endpoint
                const url = 'https://100074.pythonanywhere.com/get-coords-v3/';

                // Parameters to be sent with the request
                const params = { api_key: api_key };

                // Payload for the request
                const payload = {
                    country: 'Italy',  // Specify the country whose regions you want to retrieve
                    query: 'all'       // Specify 'all' to get all regions
                };

                // Sending a POST request to the API endpoint
                const response = await axios.post(url, payload, { params });

                // Set the regions state with the response data
                setRegions(response.data);
            } catch (error) {
                console.error('Error fetching regions:', error);
            }
        };

        // Call the fetchRegions function
        fetchRegions();
    }, []);

    return (
        <div>
            {/* Displaying the regions */}
            {regions && (
                <ul>
                    {regions.map(region => (
                        <li key={region}>{region}</li>
                    ))}
                </ul>
            )}
        </div>
    );
};

export default GetAllCountryRegions;

				
			

5. How to Get Custom Country Region Coordinates

This React component sends a request to an API endpoint to retrieve details for specific regions (in this case, Rome and Abano Terme) of a particular country (in this case, Italy). The API key is included for authentication.

				
					import React, { useState, useEffect } from 'react';
import axios from 'axios';

// Component for fetching custom country region coordinates
const GetCustomCountryRegionCoordinates = () => {
    // State to hold the coordinates
    const [coordinates, setCoordinates] = useState(null);

    useEffect(() => {
        // Function to fetch coordinates
        const fetchCoordinates = async () => {
            try {
                // Replace 'your_api_key' with your actual API key
                const api_key = 'your_api_key';

                // URL for the API endpoint
                const url = 'https://100074.pythonanywhere.com/get-coords-v3/';

                // Parameters to be sent with the request
                const params = { api_key: api_key };

                // Payload for the request
                const payload = {
                    country: 'Italy',
                    query: 'custom',
                    regionList: ['Rome', 'Abano Terme']
                };

                // Sending a POST request to the API endpoint
                const response = await axios.post(url, payload, { params });

                // Set the coordinates state with the response data
                setCoordinates(response.data);
            } catch (error) {
                console.error('Error fetching coordinates:', error);
            }
        };

        // Call the fetchCoordinates function
        fetchCoordinates();
    }, []);

    return (
        <div>
            {/* Displaying the coordinates */}
            {coordinates && (
                <p>Coordinates: {coordinates.latitude}, {coordinates.longitude}</p>
            )}
        </div>
    );
};

export default GetCustomCountryRegionCoordinates;

				
			

6. How to Get Regions by Substring

This React component helps you find regions in a country (in this case, Italy) that have a certain word or letters in their names. For example, if you’re looking for regions with names containing “Ab,” you can use this component. It sends a request to the API endpoint with the country name and the substring you’re interested in. Then, it displays information about matching regions.

				
					import React, { useState, useEffect } from 'react';
import axios from 'axios';

// Component for fetching regions by substring
const GetRegionsBySubstring = () => {
    // State to hold the regions
    const [regions, setRegions] = useState(null);

    useEffect(() => {
        // Function to fetch regions
        const fetchRegions = async () => {
            try {
                // Replace 'your_api_key' with your actual API key
                const api_key = 'your_api_key';

                // URL for the API endpoint
                const url = 'https://100074.pythonanywhere.com/get-coords-v4/';

                // Parameters to be sent with the request
                const params = { api_key: api_key };

                // Payload for the request
                const payload = [{
                    country: 'Italy',
                    query: 'all',
                    subStr: 'Ab'
                }];

                // Sending a POST request to the API endpoint
                const response = await axios.post(url, payload, { params });

                // Set the regions state with the response data
                setRegions(response.data);
            } catch (error) {
                console.error('Error fetching regions:', error);
            }
        };

        // Call the fetchRegions function
        fetchRegions();
    }, []);

    return (
        <div>
            {/* Displaying the regions */}
            {regions && (
                <ul>
                    {regions.map(region => (
                        <li key={region}>{region}</li>
                    ))}
                </ul>
            )}
        </div>
    );
};

export default GetRegionsBySubstring;

				
			

Flutter Example

1. How to Get Coordinates

This Flutter code snippet demonstrates how to retrieve coordinates for a specified region, such as Nairobi, by sending a POST request to the Dowell Coordinates API endpoint. The payload includes the region name and API key for authentication. Once the response is received, it can be further processed as needed.

				
					import 'package:http/http.dart' as http;
import 'dart:convert';

// Replace 'your_api_key' with your actual API key
String apiKey = 'your_api_key';
String url = 'https://100074.pythonanywhere.com/get-coords/';

// Function to fetch coordinates for a specified region
Future<void> getCoordinates() async {
  // Prepare payload with the region name and API key
  Map<String, String> payload = {
    "region": "Nairobi",  // Specify the region you want coordinates for
    "api_key": apiKey     // Provide your API key for authentication
  };

  // Send a POST request to the API endpoint with the payload
  http.Response response = await http.post(Uri.parse(url), body: json.encode(payload));

  // Print the JSON response from the API
  print(json.decode(response.body));
}

				
			

2. How to Get Regions

This Flutter code snippet illustrates how to retrieve information about regions by sending a GET request to the Dowell Coordinates API endpoint. The request includes the API key as a parameter for authentication. Upon receiving the response, it can be parsed and processed accordingly.

				
					import 'package:http/http.dart' as http;
import 'dart:convert';

// Replace 'your_api_key' with your actual API key
String apiKey = 'your_api_key';
String url = 'https://100074.pythonanywhere.com/regions/';

// Function to fetch information about regions
Future<void> getRegions() async {
  // Parameters to be sent with the request, including the API key
  Map<String, String> params = {"api_key": apiKey};

  // Send a GET request to the API endpoint with the specified parameters
  http.Response response = await http.get(Uri.parse(url), headers: params);

  // Print the JSON response from the API
  print(json.decode(response.body));
}

				
			

3. How to Get Countries

This Flutter code snippet showcases how to retrieve information about all countries stored in the database by sending a POST request to the Dowell Coordinates API endpoint. The API key is included as a parameter for authentication. Upon receiving the response, it can be parsed and processed accordingly.

				
					import 'package:http/http.dart' as http;
import 'dart:convert';

// Replace 'your_api_key' with your actual API key
String apiKey = 'your_api_key';
String url = 'https://100074.pythonanywhere.com/get-countries-v3/';

// Function to fetch information about all countries
Future<void> getCountries() async {
  // Parameters for the POST request, including the API key
  Map<String, String> params = {"api_key": apiKey};

  // Send a POST request to the URL with the specified parameters
  http.Response response = await http.post(Uri.parse(url), body: params);

  // Print the JSON response from the API
  print(json.decode(response.body));
}

				
			

4. How to Get All Country Regions

This Flutter code snippet demonstrates how to retrieve all regions for a specific country, such as Italy, by sending a POST request to the Dowell Coordinates API endpoint. The payload includes the country name and a query parameter to specify that all regions should be fetched. Upon receiving the response, it can be parsed and processed accordingly.

				
					import 'package:http/http.dart' as http;
import 'dart:convert';

// Replace 'your_api_key' with your actual API key
String apiKey = 'your_api_key';
String url = 'https://100074.pythonanywhere.com/get-coords-v3/';

// Function to fetch all regions for a specific country
Future<void> getAllCountryRegions() async {
  // Parameters for the request
  Map<String, String> params = {"api_key": apiKey};

  // Data payload for the request
  Map<String, dynamic> payload = {
    "country": "italy",  // Specify the country to retrieve regions for
    "query": "all"       // Specify 'all' to get all regions
  };

  // Send a POST request to the API endpoint with the provided parameters and payload
  http.Response response = await http.post(Uri.parse(url), body: json.encode(payload), headers: params);

  // Print the JSON response from the API
  print(json.decode(response.body));
}

				
			

5. How to Get Custom Country Region Coordinates

This Flutter code snippet showcases how to retrieve details for specific regions, such as Rome and Abano Terme, of a particular country, such as Italy, by sending a POST request to the Dowell Coordinates API endpoint. The payload includes the country name and a list of regions to fetch. Upon receiving the response, it can be parsed and processed accordingly.

				
					import 'package:http/http.dart' as http;
import 'dart:convert';

// Replace 'your_api_key' with your actual API key
String apiKey = 'your_api_key';
String url = 'https://100074.pythonanywhere.com/get-coords-v3/';

// Function to fetch details for specific regions of a country
Future<void> getCustomCountryRegionCoordinates() async {
  // Parameters for the API request
  Map<String, String> params = {"api_key": apiKey};

  // Payload containing the country name and regions
  Map<String, dynamic> payload = {
    "country": "italy",
    "query": "custom",
    "regionList": ["Rome", "Abano Terme"]
  };

  // Sending a POST request to the API endpoint
  http.Response response = await http.post(Uri.parse(url), body: json.encode(payload), headers: params);

  // Printing the JSON response
  print(json.decode(response.body));
}

				
			

6. How to Get Regions by Substring

This Flutter code snippet illustrates how to find regions in a country, such as Italy, that contain a certain substring (e.g., “Ab”) in their names. It sends a POST request to the Dowell Coordinates API endpoint with the country name and the substring of interest. Upon receiving the response, it can be parsed and processed accordingly.

				
					import 'package:http/http.dart' as http;
import 'dart:convert';

// Replace 'your_api_key' with your actual API key
String apiKey = 'your_api_key';
String url = 'https://100074.pythonanywhere.com/get-coords-v4/';

// Function to find regions in a country with names containing a certain substring
Future<void> getRegionsBySubstring() async {
  // Parameters for the API request
  Map<String, String> params = {"api_key": apiKey};

  // Payload containing the country name, query type, and substring
  List<Map<String, dynamic>> payload = [{
    "country": "italy",
    "query": "all",
    "subStr": "Ab"
  }];

  // Sending a POST request to the API endpoint
  http.Response response = await http.post(Uri.parse(url), body: json.encode(payload), headers: params);

  // Printing the JSON response
  print(json.decode(response.body));
}

				
			

WordPress Example

Set up the Dowell Coordinates API name and the base url. It's a prerequisite to have WP-GET API installed in your wordpress API.

Dowell Coordinates API

1. How to Get Coordinates

Step 1: Set up the api endpoint and the request body. The endpoint should have the api key and request body should have the necessary body post fields

Get Coordinates Api Endpoints
Get coordinates request body

Step 2: Test endpoint to get Json Response from the API.

Get coordinates Api Json Response

2. How to Get Regions

Step 1: Set up the api endpoint and the Query String. The Query String should have the api key.

Get regions api endpoints and Query String

Step 2: Test endpoint to get Json Response from the API.

Get regions api json response

3. How to Get Countries

Step 1: Set up the api endpoint and the Request body and Query String. The Query String should have the api key and request body should have the necessary body post fields as shown below.

Get countries api endpoints
Get countries api request body and query strings

Step 2: Test endpoint to get Json Response from the API.

Get countries api json response

4. Get All Country Regions

Step 1: Set up the api endpoint and the Request body and Query String. The Query String should have the api key and request body should have the necessary body post fields as shown below.

Get all country regions api endpoint
Get all country regions api request body and query strings

Step 2: Test endpoint to get Json Response from the API.

Get all country regions api json response

5. Get Custom Country Region Coordinates

Step 1: Set up the api endpoint and the Request body and Query String. The Query String should have the api key and request body should have the necessary body post fields as shown below.

Get custom country regions coordinates api endpoint
Get custom country regions api request body and query strings

Step 2: Test endpoint to get Json Response from the API.

Get custom country regions api json response

6. How to Get Regions by Substring

Step 1: Set up the api endpoint and the Request body and Query String. The Query String should have the api key and request body should have the necessary body post fields as shown below.

Dowell Coordinates API
Dowell Coordinates API

Step 2: Test endpoint to get Json Response from the API.

Dowell Coordinates API