• Register

ACTIVE Network API Forums

API Forum

RSS Feed

Search API location formatting

    • T4run
    • Topic created 14 years ago

    Your web interface on search.active.com seems to translate a location typed into the input field into the format you require for the l parameter in the search API. For example, when I type in Munich, Germany, the URL shows "l=Munich, Bavaria, DE". Another example - when I type in Bellmore, NY, it adds ", US". How do you translate what is typed into your input box into what is required by you search API?

    I'm just trying to figure the simplest way for a user to enter a location in my mobile app without hardcoding all of their city/state/country combinations into my app. Any tips?

    Thanks,
    Mark

    Message edited by T4run 13 years ago

  1. mvillanueva14 years ago

    The search API requires the l parameter to be in one of the following formats:

    city,state,country San Diego,CA,US
    zip,country (US,AU, or CA zips are valid) 92121,US
    US zip 92121
    Latititue;longitude 32.90183;-117.207709

    To validate the user input on the web interface, we are using the Yahoo Placemaker REST service. This service takes free form text and will return location info found in that text.

  2. T4run13 years ago

    In your repsonse, you say I can use Lat/Lon for the location query paramter but that's not in the documentation. What's the format? Would it be l=32.90183;-117.207709? Are there format requirements? Semi-colon betwen the coords.?

  3. mvillanueva13 years ago

    Yes, you have the correct format. Latitude first, followed by a semi-colon, and then longitude.

[ Page 1 of 1 ]