Marketplace Search
by SocialFetch in News & content
Search Facebook Marketplace listings by keyword near a latitude and longitude.
https://api.socialfetch.dev/v1/facebook/marketplace/search- Price
- $0.014
- per call in USDC
- Uptime
- 98.9%
- last 30 days
- Response time
- 241 ms
- 454 ms slowest 5%
- Last check
- Passed
- 25 min ago, next in 7 min
Reliability
Status and outage history · Atom feed · Watch with other listings
How to call it
GET https://api.socialfetch.dev/v1/facebook/marketplace/search
Each call costs $0.014 in USDC on Base, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
GET https://api.socialfetch.dev/v1/facebook/marketplace/search?lat=30.2677&lng=-97.7475&query=bikeParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
availability | string | No | Optional availability filter for marketplace listings. One of: available, sold, all. |
categoryId | string | No | Optional numeric Marketplace category id. Only listings in that category are returned. Listings report their category as `categoryId`. |
condition | string | No | Optional item condition filter for marketplace listings. One of: new, usedLikeNew, usedGood, usedFair. |
count | integer | No | Deprecated alias for `limit`. When both are set, `limit` wins. |
cursor | string | No | Opaque pagination cursor returned by a previous response. |
dateListed | string | No | Optional date-listed filter for marketplace listings. `1`/`last24Hours` both mean the last 24 hours, `7`/`last7Days` both mean the last 7 days, and `30`/`last30Days` both mean the last 30 days — these are separate values Facebook accepts for the same window; prefer the named variants (`last24Hours`… One of: 1, 7, 30, all, last24Hours, last7Days, last30Days. |
deliveryMethod | string | No | Optional delivery method filter for marketplace listings. One of: all, localPickup, shipping. |
lat | number | Yes | Latitude for the marketplace search location. |
limit | integer | No | Optional number of listings to return (1–100). Prefer this over `count`. |
lng | number | Yes | Longitude for the marketplace search location. |
maxPrice | number | No | Optional maximum listing price. Must be greater than or equal to `minPrice` when both are set. |
minPrice | number | No | Optional minimum listing price. Must be less than or equal to `maxPrice` when both are set. |
query | string | Yes | Search query text for marketplace listings. |
radiusKm | number | No | Optional search radius in kilometers. |
sortBy | string | No | Optional sort order for marketplace listings. `suggested`: Facebook's default relevance ranking. `distanceAscend`: nearest first. `creationTimeDescend`: newest listings first. `priceAscend`/`priceDescend`: lowest/highest price first. One of: suggested, distanceAscend, creationTimeDescend, priceAscend, priceDescend. |
Example response
The provider's example. We can't check it without paying.
Example response, 60 lines
{
"data": {
"listings": [
{
"categoryId": "1658310421102081",
"deliveryTypes": [
null
],
"id": "1365026115430019",
"location": {
"city": null,
"cityPageId": null,
"displayName": null,
"state": null
},
"price": {
"amount": null,
"amountWithOffsetInCurrency": null,
"formattedAmount": null
},
"primaryPhoto": {
"id": null,
"url": null
},
"status": {
"isHidden": null,
"isLive": null,
"isPending": null,
"isSold": null,
"isViewerSeller": null
},
"storyKey": "26197243669962791",
"storyType": "POST",
"strikethroughPrice": {
"amount": null,
"amountWithOffsetInCurrency": null,
"formattedAmount": null
},
"title": "Mountain Bike",
"url": "https://www.facebook.com/marketplace/item/1365026115430019/"
}
],
"location": {
"lat": 30.2677,
"lng": -97.7475,
"radiusKm": null
},
"page": {
"hasMore": true,
"nextCursor": "eyJwZyI6MCwiYjJjIjp7ImJyIjoiIiwiaXQiOjAsImhtc3IiOmZhbHNlLCJ0YmkiOjB9LCJjMmMiOnsiYnIiOiJBYnFSVm81bF9IQ1dteFl6VDRkdFliZUF…"
},
"query": "bike",
"totalListings": 16
},
"meta": {
"creditsCharged": 1,
"requestId": "req_01facebook_marketplace_search_example",
"version": "v1"
}
}Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.014.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i 'https://api.socialfetch.dev/v1/facebook/marketplace/search?lat=30.2677&lng=-97.7475&query=bike'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - 'https://api.socialfetch.dev/v1/facebook/marketplace/search?lat=30.2677&lng=-97.7475&query=bike' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.014 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.014" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.014 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.socialfetch.dev%2Fv1%2Ffacebook%2Fmarketplace%2Fsearch
const res = await pay("https://api.socialfetch.dev/v1/facebook/marketplace/search?lat=30.2677&lng=-97.7475&query=bike");
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.014 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.014"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.get("https://api.socialfetch.dev/v1/facebook/marketplace/search?lat=30.2677&lng=-97.7475&query=bike")
print(res.status_code, res.text)Security scan
No findings
We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 25 min ago | Passed | 402 | 253 ms | $0.014 |
| 11 h ago | Passed | 402 | 201 ms | $0.014 |
| 20 h ago | Passed | 402 | 314 ms | $0.014 |
| 31 h ago | Passed | 402 | 225 ms | $0.014 |
| 44 h ago | Passed | 402 | 241 ms | $0.014 |
Show 10 older checks
| 4 days ago | Timed out | - | - | - |
| 5 days ago | Passed | 402 | 303 ms | $0.014 |
| 6 days ago | Passed | 402 | 290 ms | $0.014 |
| 6 days ago | Passed | 402 | 409 ms | $0.014 |
| 6 days ago | Passed | 402 | 302 ms | $0.014 |
| 7 days ago | Passed | 402 | 204 ms | $0.014 |
| 7 days ago | Passed | 402 | 359 ms | $0.014 |
| 7 days ago | Passed | 402 | 324 ms | $0.014 |
| 8 days ago | Passed | 402 | 484 ms | $0.014 |
| 8 days ago | Passed | 402 | 410 ms | $0.014 |