Skip to content

Geocode Address With Bias

This function will take a search string, attempt to geocode it, and return coordinates. Search string can be as simple as a zip code or as complex as a free form address field.

Path

https://api.b-fonline.com/api/geocode_with_bias

Method

POST

Required Parameters

  • search_string (string to be geocoded)

Optional Parameters

Important: You must choose either country or region. Using both together may lead to unexpected results.

  • country (string, ISO-3166 Alpha 2 country code)
  • region (string, ISO-3166 Alpha 2 country code)
  • language (string, two character language code, found here)

Responses

  • 200 OK
    1
    2
    3
    4
    5
    6
    {
      "lat": 38.25569280000001,
      "lng": -85.751283,
      "accuracy": "APPROXIMATE",
      "formatted_address": "Louisville, KY 40202, USA"
    }
    
  • 422 (Unprocessable Entity)
    • Error message in JSON response
  • 500
    • Something has gone horribly wrong, please let us know.

Code Examples

1
2
3
4
5
curl -X POST \
  https://api.b-fonline.com/api/geocode_with_bias \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{"search_string": "40202", "country": "us"}'
1
2
3
4
5
curl -X POST \
  https://api.b-fonline.com/api/geocode_with_bias \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{"search_string": "40202", "language": "es"}'