Facebook reviews API documentation
We provide a simple to setup REST API that returns reviews in JSON format. Before integrating the API you should be aware of the following:
- The Facebook API returns 5 reviews per request.
- The order in which reviews are returned is by relevancy. This order is determined by facebook and cannot be modified
- You can get all reviews from a single place by using the
cursor
parameter. Unlike other integrations, the facebook api doesn't support the offset parameter to paginate the results. Instead the pages need to be iterated one by one. To do this, each response comes with anext_page_cursor
field. You can use the value is field to pass it as thecursor
parameter in a new request to get the next page in the results. - Facebook doesn't use a star based rating anymore. Places are either recommended or not.
You can find this in the response as the
recommends_rating
field. The value of this field will be eithernull
,recommends
ordoesnt_recommend
To get reviews from Wextractor you will need to perform GET
requests against
the https://wextractor.com/api/v1/reviews/facebook
endpoint.
Reviews endpoint parameters:
Parameter | Required | Description | Example |
---|---|---|---|
auth_token | Required | Your API token for authentication. Once you register to Wextractor you can extract this key from your account's setting page. | - |
id | Required | A textual identifier that uniquely identifies a place in Facebook. This identifier is a part of the path that appears in the url for the place in Facebook. For example, if the url for the place in Facebook is https://www.facebook.com/metmuseum/ the identifier is: metmuseum
|
metmuseum |
cursor | Optional | This parameter defines the cursor to use for pagination. After getting the first page of results without
sending the cursor parameter. The response will include a next_page_cursor field. To get the following page of results you need to create a new request adding the value of that field as the cursor parameter.
|
- |
Example usage:
https://wextractor.com/api/v1/reviews/facebook?auth_token=XXXX&id=metmuseum
Example response:
{
"reviews": [
{
"reviewer": "Andrew Ballard",
"id": "metmuseum-1584235732",
"recommends_rating": "recommends",
"text": "Such an amazing place. It is very large though so allow yourself plenty of time. Also, plan what you want to see as there is so much amazing items. Even the shops is an adventure",
"datetime": "2020-03-15 01:28:52",
"avatar": "https://scontent-bos3-1.xx.fbcdn.net/v/t1.0-1/cp0/p50x50/89869888_10216859192652114_7576716695515955200_o.jpg?_nc_cat=110&_nc_sid=dbb9e7&_nc_oc=AQm6gA3Ugj9C1HeVkAox4sfU9J9Axd7GBLYHQqRc_2HnWVJwOYU1hq-fB7NSPB-naDU&_nc_ht=scontent-bos3-1.xx&oh=20ebe4b7bd6e9ba461462722c928ba08&oe=5EA044F8"
},
{
"reviewer": "Jata Estep",
"id": "metmuseum-1583664426",
"recommends_rating": "recommends",
"text": "beautiful and alot of history! staff is great. I cant say enough good stuff about this museum.",
"datetime": "2020-03-08 10:47:06",
"avatar": "https://scontent-bos3-1.xx.fbcdn.net/v/t1.0-1/cp0/p50x50/87359748_10157629186835845_2404554285527334912_o.jpg?_nc_cat=103&_nc_sid=dbb9e7&_nc_oc=AQmR6oUYivN5UYoTNA1Vsj-PlbWI5yqFZzMHsfs6qHFGrVmcmvtYLgPeEgXxLapBs4E&_nc_ht=scontent-bos3-1.xx&oh=4f644ab8014e46b22898d0d756e5c880&oe=5EA0E2D5"
},
{
"reviewer": "Cathy Counselman Kelly",
"id": "metmuseum-1561936407",
"recommends_rating": "doesnt_recommend",
"text": "bad.",
"datetime": "2019-06-30 23:13:27",
"avatar": "https://scontent-bos3-1.xx.fbcdn.net/v/t1.0-1/cp0/p50x50/70950453_10157952388378311_385171082262347776_n.jpg?_nc_cat=111&_nc_sid=dbb9e7&_nc_oc=AQmiOySYVYvixT49zc2DZMT-4eBcjqhm4EQuYZ7r4GTvqGp6zkoI7Nw9oKbTO4JVKV4&_nc_ht=scontent-bos3-1.xx&oh=1c7eb2a8f3e6bc7ff680be2fbd148101&oe=5EA1886F"
},
{
"reviewer": "Julia Mainwaring",
"id": "metmuseum-1583181660",
"recommends_rating": "recommends",
"text": "Huge amount of art and pieces in show - fabulous setting and architecture. Helpful friendly staff and very little in the way of queues.",
"datetime": "2020-03-02 20:41:00",
"avatar": "https://scontent-bos3-1.xx.fbcdn.net/v/t1.0-1/cp0/p50x50/67163620_10157704253986614_487895215240118272_o.jpg?_nc_cat=107&_nc_sid=dbb9e7&_nc_oc=AQkf3lP10ySIiFZ_i8qbaMgqUHe5On8rljHl8ra682kpqFs4z8qYSRG-T_1f4jyniq8&_nc_ht=scontent-bos3-1.xx&oh=130897f3471a272c724db96467ac8045&oe=5E9F698D"
},
{
"reviewer": "Eva Landry",
"id": "metmuseum-1570681756",
"recommends_rating": null,
"text": "Magical place! A way to travel in time!",
"datetime": "2019-10-10 04:29:16",
"avatar": "https://scontent-bos3-1.xx.fbcdn.net/v/t1.0-1/cp0/p50x50/75226418_2606758136078462_6551325186677800960_n.jpg?_nc_cat=106&_nc_sid=dbb9e7&_nc_oc=AQnHZxPuzTU2BX71v3wVMeemWhgSriivj71jZzfPMTGIsL-xgsK6I9RZIFaktVdTqGs&_nc_ht=scontent-bos3-1.xx&oh=dcf0626e0458f778ebc22d8a20be3420&oe=5EA18DD2"
}
],
"next_page_cursor": "L2FzeW5jL3BhZ2VfcmVjb21tZW5kYXRpb24vY29uc2lkZXJhdGlvbl9zaWduYWxzX3RhYl9wYWdpbmF0aW9uLz9jdXJzb3I9JTdCJTIyaW5fcHJvZ3Jlc3NjdXJzb3JfdHlwZSUyMiUzQSUyMm9wZW5fZ3JhcGhfYW5kX3BhZ2VfcmVjJTIyJTJDJTIybG9jYWxfcmVjX3BhdHRlcm5fY3Vyc29yJTIyJTNBJTIyQVFIUndYQTZmMFBRckRwSC1wVmpxR1dlekw1TW1QQ3hNd3AyODBZbjQ0MTBORXd6RE9Ta19lTnZwNWNrNWpoVktmOFdLMmxoM0pMYWtuUVFvZ21ZVGlaNTNBJTIyJTJDJTIycmF0aW5nX2N1cnNvciUyMiUzQSUyMiUyMiUyQyUyMm9mZmxpbmVfb2Zmc2V0JTIyJTNBLTElMkMlMjJvZ19wb3N0X2N1cnNvciUyMiUzQSUyMjQlM0FORG8yTWprMk1qVXlOak0wT2pFd01EQXdNak15T1RBeU16QXpNZyUzRCUzRCUzQSUyMiU3RCZwYWdlX2lkPTYyOTYyNTI2MzQmcGFnZXJfZG9tX2lkPXVfMF82JnNob3VsZF9pbmZpbml0ZV9zY3JvbGw9MSZpc192ZXJ0ZXg9MCZzdG9yaWVzX2NvbnRhaW5lcl9kb21faWQ9cmVjb21tZW5kYXRpb25zX3RhYl9tYWluX2ZlZWQmc29ydF9vcmRlcj1tb3N0X2hlbHBmdWw="
}
Example of getting all reviews in python:
import requests
import json
auth_token = 'your token'
place_id = 'metmuseum'
url = 'https://wextractor.com/api/v1/reviews/facebook?auth_token=' + auth_token + '&id=' + place_id
all_reviews = []
reviews = json.loads(requests.get(url).text)
all_reviews += reviews['reviews']
while reviews['next_page_cursor']:
page_url = url + '&cursor=' + reviews['next_page_cursor']
reviews = json.loads(requests.get(page_url).text)
all_reviews += reviews['reviews']
print(reviews)