latstringbắt buộc
Latitude of the search location (e.g. '30.2677').
https://api.sandbase.ai/v1/api/facebook/marketplaceSearch Facebook Marketplace listings by keyword near a location, filter by price, condition, delivery, recency, and availability, and get title, price, location, and image 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 page of Facebook Marketplace listings that match a keyword near a latitude and longitude. Each listing includes title, price, city, photo, delivery types, and a link to the item. You send query, lat, and lng, and can add price, condition, delivery, recency, availability, and sort filters.
creation_time_descend.priceAmount.availability set to sold to see what items sold for in an area.curl -X POST "https://api.sandbase.ai/v1/api/facebook/marketplace" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"lat": "30.2677", "lng": "-97.7475", "query": "bike", "priceMax": 500, "priceMin": 100}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
lat | string | Yes | Latitude of the search location (e.g. '30.2677'). |
lng | string | Yes | Longitude of the search location (e.g. '-97.7475'). |
query | string | Yes | Search keyword for Marketplace listings (e.g. 'bike'). |
availability | string | No | Filter by availability: available (default), sold, or all (e.g. sold). |
condition | string | No | Only return listings in this condition (e.g. used_good). |
cursor | string | No | Pagination cursor from a previous response to fetch the next page. |
dateListed | string | No | Only return listings posted within this window (e.g. last_7_days). |
deliveryMethod | string | No | Only return listings offering this delivery method (e.g. shipping). |
priceMax | integer | No | Maximum listing price in whole currency units, e.g. 500 for $500. Facebook may mix in a few suggested listings outside the range. |
priceMin | integer | No | Minimum listing price in whole currency units, e.g. 100 for $100. Facebook may mix in a few suggested listings outside the range. |
sort | string | No | Sort order for the returned listings (e.g. price_ascend). |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"hasNextPage": true,
"listings": [
{
"categoryId": "1658310421102081",
"city": "Austin",
"cityPageId": "106224666074625",
"createdUtc": 1788826593,
"deliveryTypes": [
"IN_PERSON"
],
"id": "2010100319696587",
"isHidden": false,
"isLive": true,
"isPending": false,
"isSold": false,
"listingDateText": "Listed 1 month ago",
"locationName": "Austin, Texas"
}
],
"nextCursor": "cur_jXjcjdldJp1WvqUPdeX5sw"
},
"found": true
}
| Field | Meaning |
|---|---|
data.listings[].id | Marketplace listing ID. Use it to build the item link or to look up the listing in detail. |
data.listings[].title | Title the seller gave the listing. |
data.listings[].priceAmount / data.listings[].priceFormatted | Listing price as a number and as display text, for example 350 and $350. |
data.listings[].city / data.listings[].state / data.listings[].locationName | Where the item is listed, as city, state code, and a combined place name. |
data.listings[].createdUtc | Time the listing was created, as a Unix timestamp in seconds. |
data.listings[].listingDateText | Relative age of the listing as shown on Facebook, for example Listed 2 weeks ago. |
data.listings[].deliveryTypes | List of delivery options the seller offers, such as IN_PERSON, PUBLIC_MEETUP, and DOOR_PICKUP. |
data.listings[].isSold / data.listings[].isPending / data.listings[].isLive / data.listings[].isHidden | Status flags for the listing. |
data.listings[].photoUrl | URL of the main listing photo. |
data.listings[].url | Direct link to the listing on Facebook Marketplace. |
data.hasNextPage / data.nextCursor | hasNextPage shows whether more results exist. nextCursor is the value to send as cursor for the next page. |
cursor set to data.nextCursor. Stop when data.hasNextPage is false.lat and lng as a Marketplace location. Facebook Marketplace Location Search can help you find coordinates for a place name.id to get more detail on a single listing.priceMin and priceMax use whole currency units. A few suggested listings outside the range can still appear.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/marketplace" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lat": "30.2677",
"lng": "-97.7475",
"query": "bike",
"priceMax": 500,
"priceMin": 100
}'Đặ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.
latstringbắt buộcLatitude of the search location (e.g. '30.2677').
lngstringbắt buộcLongitude of the search location (e.g. '-97.7475').
querystringbắt buộcSearch keyword for Marketplace listings (e.g. 'bike').
sortstringSort order for the returned listings (e.g. price_ascend).
Giá trị có thể dùng: suggested, distance_ascend, creation_time_descend, price_ascend, price_descend
cursorstringPagination cursor from a previous response to fetch the next page.
priceMaxintegerMaximum listing price in whole currency units, e.g. 500 for $500. Facebook may mix in a few suggested listings outside the range.
priceMinintegerMinimum listing price in whole currency units, e.g. 100 for $100. Facebook may mix in a few suggested listings outside the range.
conditionstringOnly return listings in this condition (e.g. used_good).
Giá trị có thể dùng: new, used_like_new, used_good, used_fair
dateListedstringOnly return listings posted within this window (e.g. last_7_days).
Giá trị có thể dùng: all, last_24_hours, last_7_days, last_30_days
availabilitystringFilter by availability: available (default), sold, or all (e.g. sold).
Giá trị có thể dùng: available, sold, all
deliveryMethodstringOnly return listings offering this delivery method (e.g. shipping).
Giá trị có thể dùng: all, local_pickup, shipping
Đâ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 MarketplaceAPI 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/marketplace 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: lat (string), lng (string) và query (string). Tùy chọn: sort (một trong số suggested, distance_ascend, creation_time_descend, price_ascend, price_descend), cursor (string), priceMax (integer), priceMin (integer), condition (một trong số new, used_like_new, used_good, used_fair) và dateListed (một trong số all, last_24_hours, last_7_days, last_30_days) và 2 mục khác. 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 Marketplace 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.