Radek82
Radek82

Reputation: 196

linkedin company auto complete (autocomplete)

Trying to get autocomplete to work in my app when searching for companies. In my case i am searching for "ska" Three (3) diffenrent scenarios:

1 - Go to https://www.linkedin.com/ta/federator?types=company&query=ska in your browser. Result: You get json response with data.

2. Try calling it via javascript Front-End

        $("#birds").autocomplete({
            minLength: 3,
            source: function (request, response) {
                // request.term is the term searched for.
                // response is the callback function you must call to update the autocomplete's 
                // suggestion list.
                $.ajax({
                    url: "https://www.linkedin.com/ta/federator?types=company",
                    data: { query: request.term },
                    dataType: "json",
                    success: response,
                    error: function () {
                        response([]);
                    }
                });
            }

        });

Result: Null

Scenario 3:

Make a call to the LinkedIn API with your APi and secret key. API Call the "company-search?keywords={your-partial-word}" Result: The searchhits is nothing like the autocomplete. The autocomplete suggestions are much better.

Suggestions on how to build a autocomlete for LinkedIn when searching for comapnies only.

As mentioned there are two different ways.

  1. Calling the https://www.linkedin.com/ta/federator?types=company&query={name}
  2. Using LinkedIn API - not good nor expected result as shown when using (1)

Upvotes: 0

Views: 1260

Answers (1)

VELVETDETH
VELVETDETH

Reputation: 314

I think a good way to do this is:

  1. Build a local server, which could handle your request to query, and send your query to linkedin query url(This would eliminate the CORS problem)
  2. In that autocomplete js code, set the url to be your local server.

Upvotes: 0

Related Questions