Christian Ucs
Christian Ucs

Reputation: 96

How to make a Facebook search request to find Locations

I use Facebook C# SDK. I try to make a Facebook search request to retrieve locations without success.

I don't know all the parameters which can be used in a "search" request.

I use this code:

Dictionary<string,object> searchParams = new Dictionary<string,object>(); 
searchParams.Add("q", "Orange");    
searchParams.Add("type", "place");      
searchParams.Add("country", "France");      

FacebookClient fbClient = new FacebookClient(token); 
var searchedPlaces = fbClient.Get("/search", searchParams); 

I receive a response with some places everywhere in the world not only in France!! The filters "category" and "country" have no effect.

Which parameters can be used in the request ? Where find the parameters list for a search request?

How to fix parameters "category", "country" and what write in the parameter "q"?

Upvotes: 1

Views: 730

Answers (1)

Igy
Igy

Reputation: 43816

From the Documentation:

The example search for places is given as https://graph.facebook.com/search?q=coffee&type=place&center=37.76,122.427&distance=1000 - you'll need an access token but otherwise that works fine for me; the response shows Coffee shops centered around those coordinates

{edit} The only search options are

  1. q for a text based query
  2. center (with coordinates) and distance to specify the approximate location
  3. Both of the above

Upvotes: 1

Related Questions