1

I am using the library linkedin-j to use the linkedin API in Java. I am testing the search functionality but it seems that only return people near me, and I need to search people who has not relation with me, or people from any university or something like that.

I am using this code:

 Map<SearchParameter, String> searchParameters = new EnumMap<SearchParameter, String>(SearchParameter.class);
 searchParameters.put(SearchParameter.KEYWORDS, "University of X");        

 People people = client.searchPeople(searchParameters);
 System.out.println("Total search result:" + people.getCount());

 for (Person person : people.getPersonList()) {
     System.out.println(person.getId() + ":" + person.getFirstName() + " " +
     person.getLastName() + ":" + person.getHeadline());
 }

It returns me nothing.

However if i put my lastname in the parameters.

    searchParameters.put(SearchParameter.LAST_NAME, "MYLASTNAME");

It returns me only me.

Please, how can i search more people with this API?

dlopezgonzalez
  • 4,217
  • 5
  • 31
  • 42

2 Answers2

0

You must look for the dev for more details. According to me linked provides us access only to 1st degree connections. You can use the LinkedIn REST console to try out more... Hope this helps you.

akzhere
  • 323
  • 4
  • 11
  • No, it does not. Using REST console and searching for the same keyword i obtain nothing. http://api.linkedin.com/v1/people-search?last-name=ANY_LASTNAME, i obtain nothing. – dlopezgonzalez Feb 09 '13 at 13:43
0

To access people out of the network use Factes

 if(!searchParameters.isEmpty()) {
              System.out.println("Searching for users.");
             facets  = new ArrayList<Parameter<FacetType,String>>();
             facets.add(new Parameter<FacetType, String>(FacetType.NETWORK, RelationshipCodes.FIRST_DEGREE_CONNECTIONS));
              facets.add(new Parameter<FacetType, String>(FacetType.NETWORK, RelationshipCodes.OUT_OF_NETWORK_CONNECTIONS));
              facets.add(new Parameter<FacetType, String>(FacetType.NETWORK, RelationshipCodes.SECOND_DEGREE_CONNECTIONS));



            }

Use Following Api to acess profile attribute other than firstname,lastname,id.

 peopleSearch = client.searchPeople(searchParameters, EnumSet.of(ProfileField.FIRST_NAME, ProfileField.LAST_NAME, ProfileField.ID, ProfileField.HEADLINE,ProfileField.DISTANCE), EnumSet.of(FacetField.NAME, FacetField.CODE, FacetField.BUCKET_NAME, FacetField.BUCKET_CODE, FacetField.BUCKET_COUNT), facets);
anshad
  • 824
  • 8
  • 19