urlstringbắt buộc
URL of a city's or place's Facebook Events page (e.g. https://www.facebook.com/events/explore/saint-petersburg-florida/111326725552547).
https://api.sandbase.ai/v1/api/facebook/eventsList public Facebook events for a city or place by its events-page URL (event name, date, venue, and attendance) as normalized JSON.
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
Returns a list of public Facebook events for a city or place. It needs the URL of a Facebook Events page, such as a city's events explore page. Each event includes its name, start time, venue, and going and interested counts.
interestedCount and goingCount to find the most popular ones.curl -X POST "https://api.sandbase.ai/v1/api/facebook/events" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.facebook.com/events/explore/saint-petersburg-florida/111326725552547"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL of a city's or place's Facebook Events page (e.g. https://www.facebook.com/events/explore/saint-petersburg-florida/111326725552547). |
cursor | string | No | Pagination cursor from a previous response to fetch the next page. |
time | string | No | Timeframe filter for the returned events. Defaults to all time. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"events": [
{
"coverImage": "https://scontent-lga3-1.xx.fbcdn.net/v/t39.30808-6/691737832_122221920272546827_…",
"dayTimeSentence": "Sat, Nov 7 at 3:00 PM EST",
"eventKind": "PUBLIC_TYPE",
"goingCount": 250,
"id": "1009766568177406",
"interestedCount": 7400,
"isHappeningNow": false,
"isOnline": false,
"isPast": false,
"name": " 90s Day Party: St. Petersburg, FL 💿",
"placeId": "122231702342546827",
"placeName": "2655 6th Ave S, St Petersburg, FL 33712-1653, United States"
}
],
"nextCursor": "cur_4pRRU2-BvJCuoK3XKQ1TtA"
},
"found": true
}
| Field | Meaning |
|---|---|
data.events[].name | Title of the event. |
data.events[].id / data.events[].url | Event ID and the link to the event page on Facebook. |
data.events[].startTimestamp | Event start time as a Unix timestamp in seconds. |
data.events[].dayTimeSentence | Readable date and time text, such as Sat, Nov 7 at 3:00 PM EST. Multi-day events show a date range. |
data.events[].placeName | Venue name or street address of the event. |
data.events[].placeId | ID of the venue on Facebook. |
data.events[].goingCount / data.events[].interestedCount | Number of people who marked the event as going and as interested. |
data.events[].isOnline / data.events[].isPast / data.events[].isHappeningNow | Flags that show if the event is online, already over, or in progress. |
data.events[].coverImage | URL of the event's cover image. |
data.nextCursor | Cursor for the next page of events. |
url from the events explore page of a city or place on Facebook.data.nextCursor back as cursor with the same url.time with today, this_week, or next_week to narrow the results. Without it, all upcoming events are returned.id to Facebook Event Details.Billed at the actual cost of each call, about $0.0012 for the request above. Failed calls are not charged.
Bắt đầu xây dựng
Endpoint API của nền tảng với xác thực và theo dõi mức sử dụng thống nhất.
curl -X POST "https://api.sandbase.ai/v1/api/facebook/events" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.facebook.com/events/explore/saint-petersburg-florida/111326725552547"
}'Đặt SandBase API key của bạn trong môi trường máy chủ. Các request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key của bạn trên máy chủ. Không hiển thị trong mã chạy trên trình duyệt.
urlstringbắt buộcURL of a city's or place's Facebook Events page (e.g. https://www.facebook.com/events/explore/saint-petersburg-florida/111326725552547).
timestringTimeframe filter for the returned events. Defaults to all time.
Giá trị có thể dùng: today, this_week, next_week
cursorstringPagination cursor from a previous response to fetch the next page.
Đây là phản hồi ví dụ đã lưu cho API này; không có request thực nào được gửi khi xem mục này.
Chưa có phản hồi đã lưu nào được công bố. Chạy API trong Playground để xem phản hồi.
Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
Facebook EventsAPI này Facebook | Từ $0.0012 mỗi lần gọi | JSON |
Facebook | Từ $0.0012 mỗi lần gọi | JSON |
Facebook | Từ $0.00462 mỗi lần gọi | JSON |
Facebook | Từ $0.0012 mỗi lần gọi | JSON |
Facebook | Từ $0.0011 mỗi lần gọi | JSON |
Facebook | Từ $0.0011 mỗi lần gọi | JSON |
Câu hỏi
Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/facebook/events với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.
Từ $0.0012 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.
Bắt buộc: url (string). Tùy chọn: time (một trong số today, this_week, next_week) và cursor (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.
Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.
Không. Facebook Events chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Facebook.