# 🌐📍Trueway Geocoding API: Forward and Reverse Geocoding

### Developer Portal : <https://api.market/store/trueway/geocoding>

### Unlock the Power of Location with Trueway Geocoding API

#### Transform Addresses into Coordinates and Coordinates into Addresses

**Trueway Geocoding API** offers a robust and reliable alternative to Google Maps, providing comprehensive geocoding services that meet your business needs at a much more affordable price. Whether you need to convert an address into geographic coordinates (forward geocoding) or transform coordinates into a human-readable address (reverse geocoding), Trueway has you covered with global coverage and multi-language support.

#### Why Choose Trueway Geocoding API?

* **Global Coverage**: Access accurate geocoding services anywhere in the world.
* **Forward Geocoding**: Seamlessly convert street addresses into precise latitude and longitude coordinates.
* **Reverse Geocoding**: Easily translate geographic coordinates into human-readable addresses.
* **Multi-Language Support**: Receive geocoding results in the language you prefer with support for ISO 639-1 language codes.
* **Cost-Effective**: Trueway Geocoding API is more affordable compared to Google Geocoding API, providing you with the same high-quality service at a lower price.

#### Powerful Features and Capabilities

**Forward Geocoding**

Forward geocoding allows you to transform any address into geographic coordinates. Simply provide the street address, and let Trueway handle the rest.

**Required Parameter:**

* **address**: The street address you wish to geocode.

**Optional Parameters:**

* **language**: Specify the two-letter language code (ISO 639-1) for results.
* **bounds**: Prefer results within a specified rectangular area (format: south, west, north, east).
* **country**: Bias results towards a specific country using the two-letter country code (ccTLD or ISO 3166-1).

**Reverse Geocoding**

Reverse geocoding is perfect for when you need to convert geographic coordinates into a detailed, human-readable address.

**Required Parameter:**

* **location**: The geographic coordinates (latitude/longitude) you wish to reverse geocode.

**Optional Parameter:**

* **language**: Specify the two-letter language code (ISO 639-1) for results.

#### Detailed Geocoding Responses

Every geocoding response from Trueway includes a wealth of information:

* **Address Components**: Detailed elements such as street, house number, neighborhood, and locality.
* **Postal Code and Country**: Accurate postal codes and country information.
* **Region and Area**: Comprehensive regional and area details.
* **Location Type**: Identify whether the result is exact, approximate, or a centroid.
* **Address Types**: Differentiated types like street address, route, road intersection, administrative area, and more.

**Trueway Geocoding API – Your Trusted Partner for Location Data**

Whether you are developing a **maps API**, enhancing delivery services, or simply need accurate **geo location API** data, Trueway provides the tools and support you need to succeed. Start your geocoding journey today and unlock the power of location with Trueway Geocoding API. Find out **about my location** with precise **map coordinates** and convert **latitude and longitude to address** effortlessly with our advanced geocoding solutions.

#### Request and Response

**Request**

{% tabs %}
{% tab title="curl" %}

```bash
curl -X 'GET' \
  'https://prod.api.market/api/v1/trueway/geocoding/GeocodingService/Geocode?address=505%20Howard%20St%2C%20San%20Francisco&country=US&language=en&bounds=-90.0%2C-180.0%2C90.0%2C180.0' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY'
```

{% endtab %}

{% tab title="Nodejs" %}

```bash
const fetch = require('node-fetch');

let url = 'https://prod.api.market/api/v1/trueway/geocoding/GeocodingService/Geocode?address=505%20Howard%20St%2C%20San%20Francisco&postal_code=SOME_STRING_VALUE&country=US&area=SOME_STRING_VALUE&locality=SOME_STRING_VALUE&street=SOME_STRING_VALUE&language=en&region=SOME_STRING_VALUE&bounds=-90.0%2C-180.0%2C90.0%2C180.0';

let options = {method: 'GET', headers: {'x-api-market-key': 'SOME_STRING_VALUE'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("api.magicapi.dev")

headers = { 'x-api-market-key': "SOME_STRING_VALUE" }

conn.request("GET", "/api/v1/trueway/geocoding/GeocodingService/Geocode?address=505%20Howard%20St%2C%20San%20Francisco&postal_code=SOME_STRING_VALUE&country=US&area=SOME_STRING_VALUE&locality=SOME_STRING_VALUE&street=SOME_STRING_VALUE&language=en&region=SOME_STRING_VALUE&bounds=-90.0%2C-180.0%2C90.0%2C180.0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://prod.api.market/api/v1/trueway/geocoding/GeocodingService/Geocode?address=505%20Howard%20St%2C%20San%20Francisco&postal_code=SOME_STRING_VALUE&country=US&area=SOME_STRING_VALUE&locality=SOME_STRING_VALUE&street=SOME_STRING_VALUE&language=en&region=SOME_STRING_VALUE&bounds=-90.0%2C-180.0%2C90.0%2C180.0")
  .get()
  .addHeader("x-api-market-key", "SOME_STRING_VALUE")
  .build();

Response response = client.newCall(request).execute();
```

{% endtab %}
{% endtabs %}

**Response**

```json
{
  "results": [
    {
      "address": "505 Howard St, San Francisco, CA 94105, USA",
      "postal_code": "94105",
      "country": "United States",
      "region": "California",
      "area": "San Francisco County",
      "locality": "San Francisco",
      "neighborhood": "SoMa",
      "street": "Howard Street",
      "house": "505",
      "location": {
        "lat": 37.787926,
        "lng": -122.396187
      },
      "location_type": "exact",
      "type": "street_address"
    }
  ]
}
```

#### Request and Response of ReverseGeocode

#### Request

```bash
curl -X 'GET' \
  'https://prod.api.market/api/v1/trueway/geocoding/GeocodingService/ReverseGeocode?location=37.7879493%2C-122.3961974&language=en' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY'
```

#### Response

```json
{
  "results": [
    {
      "address": "505 Howard St, San Francisco, CA 94105, USA",
      "postal_code": "94105",
      "country": "United States",
      "region": "California",
      "area": "San Francisco County",
      "locality": "San Francisco",
      "neighborhood": "SoMa",
      "street": "Howard Street",
      "house": "505",
      "location": {
        "lat": 37.787926,
        "lng": -122.396187
      },
      "location_type": "exact",
      "type": "poi"
    },
    {
      "address": "18 Tehama St, San Francisco, CA 94105, USA",
      "postal_code": "94105",
      "country": "United States",
      "region": "California",
      "area": "San Francisco County",
      "locality": "San Francisco",
      "neighborhood": "SoMa",
      "street": "Tehama Street",
      "house": "18",
      "location": {
        "lat": 37.78795,
        "lng": -122.396136
      },
      "location_type": "exact",
      "type": "street_address"
    },
    {
      "address": "505 Howard St, San Francisco, CA 94105, USA",
      "postal_code": "94105",
      "country": "United States",
      "region": "California",
      "area": "San Francisco County",
      "locality": "San Francisco",
      "neighborhood": "SoMa",
      "street": "Howard Street",
      "house": "505",
      "location": {
        "lat": 37.787926,
        "lng": -122.396187
      },
      "location_type": "exact",
      "type": "street_address"
    },
    {
      "address": "22 Tehama St, San Francisco, CA 94105, USA",
      "postal_code": "94105",
      "country": "United States",
      "region": "California",
      "area": "San Francisco County",
      "locality": "San Francisco",
      "neighborhood": "SoMa",
      "street": "Tehama Street",
      "house": "22",
      "location": {
        "lat": 37.787717,
        "lng": -122.395972
      },
      "location_type": "approximate",
      "type": "street_address"
    },
    {
      "address": "QJQ3+5G SoMa, San Francisco, CA, USA",
      "country": "United States",
      "region": "California",
      "area": "San Francisco County",
      "locality": "San Francisco",
      "neighborhood": "SoMa",
      "location": {
        "lat": 37.787926,
        "lng": -122.396187
      },
      "location_type": "centroid",
      "type": "poi"
    }
  ]
}
```

### Developer Portal : <https://api.market/store/trueway/geocoding>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.api.market/api-product-docs/trueway/trueway-geocoding-api-forward-and-reverse-geocoding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
