78trust / 100

Marketplace Search

by SocialFetch in News & content

x402 APIPassing, checked 25 min ago

Search Facebook Marketplace listings by keyword near a latitude and longitude.

GET
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

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

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=bike

Parameters

ParameterTypeRequiredDescription
availabilitystringNoOptional availability filter for marketplace listings. One of: available, sold, all.
categoryIdstringNoOptional numeric Marketplace category id. Only listings in that category are returned. Listings report their category as `categoryId`.
conditionstringNoOptional item condition filter for marketplace listings. One of: new, usedLikeNew, usedGood, usedFair.
countintegerNoDeprecated alias for `limit`. When both are set, `limit` wins.
cursorstringNoOpaque pagination cursor returned by a previous response.
dateListedstringNoOptional 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.
deliveryMethodstringNoOptional delivery method filter for marketplace listings. One of: all, localPickup, shipping.
latnumberYesLatitude for the marketplace search location.
limitintegerNoOptional number of listings to return (1–100). Prefer this over `count`.
lngnumberYesLongitude for the marketplace search location.
maxPricenumberNoOptional maximum listing price. Must be greater than or equal to `minPrice` when both are set.
minPricenumberNoOptional minimum listing price. Must be less than or equal to `maxPrice` when both are set.
querystringYesSearch query text for marketplace listings.
radiusKmnumberNoOptional search radius in kilometers.
sortBystringNoOptional 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 --decode
JavaScript: 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

WhenResultHTTPTimePrice
25 min agoPassed402253 ms$0.014
11 h agoPassed402201 ms$0.014
20 h agoPassed402314 ms$0.014
31 h agoPassed402225 ms$0.014
44 h agoPassed402241 ms$0.014
Show 10 older checks
4 days agoTimed out---
5 days agoPassed402303 ms$0.014
6 days agoPassed402290 ms$0.014
6 days agoPassed402409 ms$0.014
6 days agoPassed402302 ms$0.014
7 days agoPassed402204 ms$0.014
7 days agoPassed402359 ms$0.014
7 days agoPassed402324 ms$0.014
8 days agoPassed402484 ms$0.014
8 days agoPassed402410 ms$0.014