Facebook API: guide to search and filter by language or location

Table of Content
Intro

Facebook is visited by over one and a half million people a month. Due to such a volume of information, it is sometimes difficult to search and filter data by some definite places and in specific languages.


If you need reliable data by location or language from Facebook, try our Data365 Facebook API for developers. This Data365 Facebook API will be of great importance for companies dealing with marketing analytics. Applying our Facebook API, you can search for different information types using keywords or phrases. You also can limit your search to any country or place. Although it is not available to limit your search for posts by language, you can filter the received search results to obtain messages only with sought language.

Search settings for our Facebook API

You can search for key phrases in any language, for example, Malaysian

An example of a POST request to search for posts by a key phrase in Malaysian, similarly in any other languages:

Malaysian:

COPY

https://api.data365.co/v1.1/facebook/search/negara%20kegemaran/posts/latest/update?max_posts=25&access_token=TOKEN

Indonesian:

COPY

https://api.data365.co/v1.1/facebook/search/negara%20favorit/posts/latest/update?max_posts=25&access_token=TOKEN

An example of a GET request to get the post from the search by a key phrase in Malaysian, similarly in any other languages:

Malaysian:

COPY

https://api.data365.co/v1.1/facebook/search/negara%20kegemaran/posts/latest/posts?access_token=TOKEN

Indonesian:

COPY

https://api.data365.co/v1.1/facebook/search/negara%20favorit/posts/latest/update?access_token=TOKEN

You can use tag search

A Facebook tag search usually returns a limited number of posts (100-200 posts). These are mainly the newest and most popular posts. Filters are not available when you send a POST request for searching. Filters are available for GET requests.

A search by tag POST request example:

COPY

https://api.data365.co/v1.1/facebook/search/toyota/posts/hashtag/update?max_posts=25&access_token=TOKEN

A GET request example for getting posts by tag:

COPY

https://api.data365.co/v1.1/facebook/search/toyota/posts/hashtag/posts?access_token=TOKEN

You can search by limiting your search to a country or place such as Malaysia

Please note, to set some place, you need to use the Facebook location id of that place. For instance, for Malaysia it is 107674002595670.

Here is an illustration of how to find a Facebook location id for Indonesia:

  1. Search for Indonesia by keyword
  2. Select the search category "Places"
  3. Find a page with the name Indonesia with the type: Place - Country (Region)

Go to the selected page. You will find the Facebook location ID of the country that you selected in the URL of the page. In this particular case, the Facebook location ID of Indonesia is 103728359665916. Now it can be used to create a search query.

A POST request example with a search for posts limited to a specific location:

COPY

https://api.data365.co/v1.1/facebook/search/negara/posts/latest/update?location_id=103728359665916&max_posts=25&access_token=TOKEN

An example of a GET query to get search results:

COPY

https://api.data365.co/v1.1/facebook/search/negara/posts/latest/posts?location_id=103728359665916&access_token=TOKEN

You cannot limit the search for posts by language (but you can filter posts by “lang” field)

A POST request example:

COPY

https://api.data365.co/v1.1/facebook/search/negara/posts/latest/update?location_id=103728359665916&max_posts=25&access_token=TOKEN

An example of a GET request that will provide a list of only those POST query search results in which the message language was recognized as Indonesian:

COPY

https://api.data365.co/v1.1/facebook/search/negara/posts/latest/posts?location_id=103728359665916&lang=id&access_token=TOKEN

As you can see, Data365 Facebook API is a reliable tool that can help you to obtain the information you need and filter it by definite parameters such as location or language. We are highly convinced it's an excellent option for your business's efficient growth.