Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list of Page Categories on facebook

I'm developing a facebook search and I would like to list all the page categories (is not relevant but I'm working with koala ruby gem):

A search with type="page" has results like these:

{"category"=>"Community", "name"=>"Koala", "id"=>"7356642860"}
{"category"=>"Product/service", "name"=>"Koala Groupe", "id"=>"188919981197745"}
{"category"=>"Public figure", "name"=>"Cushelle Koala", "id"=>"109202405786555"}
{"category"=>"Dancer", "name"=>"Koala Dance Bots", "id"=>"208563099183596"}
{"category"=>"Musician/band", "name"=>"Kid Koala", "id"=>"17527901121"}
{...}

I'm trying to develop a form to permit the user to achieve a a more precise search.

Then, I would like the user to have a list of categories, but: How to get the facebook pages categories list?

like image 741
Fran Martinez Avatar asked Dec 20 '22 09:12

Fran Martinez


1 Answers

Use the following API to get list of page categories

FB.api(
  '/fb_page_categories',
  'GET',
  {},
  function(response) {
      // Insert your code here
  }
);
You will get response as
 {
    "data": [
      {
        "name": "Advertising/Marketing",
        "fb_page_categories": [
          {
            "name": "Advertising Agency",
            "id": "164886566892249"
          },
          {
            "name": "Brand Agency",
            "id": "1736039333278498"
          },
          {
            "name": "Copywriting Service",
            "id": "197029287003787"
          },
          {
            "name": "Digital/Online Marketing Agency",
            "id": "1751954525061797"
          },
          {
            "name": "Internet Marketing Service",
            "id": "1706730532910578"
          },
          {
            "name": "Marketing Agency",
            "id": "123377808095874"
          },
          {
            "name": "Marketing Consultant",
            "id": "170992992946914"
          },
          {
            "name": "Media Agency",
            "id": "281507032196735"
          },
          {
            "name": "Public Relations Agency",
            "id": "192021210817573"
          },
          {
            "name": "Social Media Agency",
            "id": "530553733821238"
          },
          {
            "name": "Telemarketing Service",
            "id": "197557456921449"
          }
        ],
        "id": "1757592557789532"
      }

and so on.... 
like image 92
Apoorv Avatar answered Jan 13 '23 10:01

Apoorv