Skip to main content

Examples - Location API

Examples

We've provided code samples in Python, cURL, Ruby, Go and JavaScript. If you aren't comfortable working in any of these languages, feel free to use go directly to our Rapid API portal to find other languages of your choice.

Our Rapid API portal provides examples for the following languages:

  • C (Libcurl)
  • Clojure (clj-http)
  • C# (HttpClient, RestSharp)
  • Http (Http/1.1)
  • Java (AyncHttp, java.net.http, OKHttp, Unirest)
  • Javascript (XmlHttpRequest, Axios, fetch, JQuery)
  • Kotlin (OKHttp)
  • Node.js (Http, Request)
  • Objective-C (NSurlSession)

 

Predictive text searches

"I have an application that requires predictive text location search functionality.  When the user starts typing it needs to be able to pull through the locations in real time.  Each returned result needs to contain any or all variations for the entered  location name, it also needs to return the associated geourn code"

To achieve this functionality you could call the following get request

https://linkedin-geourn-codes1.p.rapidapi.com/api/Location?id=manchester

The output response:

{
    "responseType": "Success",
    "locationList": [
        {
            "id": 47447,
            "location": "Manchester,Kentucky,United States",
            "geoUrn": 104846079,
            "count": 34872
        },
        {
            "id": 47449,
            "location": "Manchester,England,United Kingdom",
            "geoUrn": 104116710,
            "count": 327898
        },
        {
            "id": 519525,
            "location": "Manchester,New Hampshire,United States",
            "geoUrn": 104439903,
            "count": 0
        },
        {
            "id": 519565,
            "location": "Manchester,Manchester,Jamaica",
            "geoUrn": 103929143,
            "count": 0
        }
    ],
    "count": 4,
    "message": "We found 4 locations, the max we will return per request is 7"
}

LinkedIn link conversion

"I want to be able to take a LinkedIn search and parse the location id's into real name equivalents."

Your software can parse the id directly from the link.

The geourn code can then be passed into the location api

https://linkedin-geourn-codes1.p.rapidapi.com/api/Location?id=102943586

The output response is able to return the exact location.

{
    "responseType": "Success",
    "locationList": [
        {
            "id": 43748,
            "location": "Leeds,England,United Kingdom",
            "geoUrn": 102943586,
            "count": 107685
        }
    ],
    "count": 0,
    "message": "We found 1 locations, the max we will return per request is 7"
}

Cookie Notice

We and third parties such as our customers, partners, and service providers use cookies and similar technologies (\"cookies\") to provide and secure our Services, to understand and improve their performance, and to serve relevant information. For more information, see our Cookie Policy.

Back to top