Before you start
- Get an API keySign up for 100 free credits, no card. Keys start with
gs_live_. - Put it in the environmentEvery example reads it from
GROUNDSOCIAL_API_KEY:export GROUNDSOCIAL_API_KEY=gs_live_… - Set up Go
go mod init example
Call Facebook Marketplace listing API from Go
GET /v1/facebook/marketplace/items/{id}. Save this as main.go and run go run main.go. It prints redacted_description.text.
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"time"
)
// The fields this program reads, as the recorded response has them.
type Page struct {
RedactedDescription struct {
Text string `json:"text"`
} `json:"redacted_description"`
}
var client = &http.Client{Timeout: 60 * time.Second}
func fetch() (*Page, error) {
req, err := http.NewRequest("GET", "https://api.groundsocial.dev/v1/facebook/marketplace/items/1154689397205553", nil)
if err != nil {
return nil, err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("GROUNDSOCIAL_API_KEY"))
res, err := client.Do(req)
if err != nil {
return nil, err
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
var e struct {
Error struct {
Code string `json:"code"`
Hint string `json:"hint"`
Retryable bool `json:"retryable"`
} `json:"error"`
}
json.NewDecoder(res.Body).Decode(&e)
return nil, fmt.Errorf("%s: %s", e.Error.Code, e.Error.Hint)
}
var page Page
if err := json.NewDecoder(res.Body).Decode(&page); err != nil {
return nil, err
}
return &page, nil
}
func main() {
page, err := fetch()
if err != nil {
log.Fatal(err)
}
fmt.Println(page.RedactedDescription.Text)
}The response
A real Facebook response to this call, recorded from the live API on 27 Nov 2026 and shortened for display: arrays keep their first items and … marks every cut. Live calls return current data in the same shape.
{
"__typename": "GroupCommerceProductItem",
"__isMarketplaceListingRenderable": "GroupCommerceProductItem",
"primary_mp_ent": {
"__typename": "GroupCommerceProductItem",
"id": "1154689397205553"
},
"__isMarketplaceListingWithDeliveryOptions": "GroupCommerceProductItem",
"shipping_profile": null,
"is_buy_now_enabled": false,
"is_shipping_offered": false,
"should_hide_pdp_shipping_content": true,
"__isMarketplaceListingWithTypeFilter": "GroupCommerceProductItem",
"if_listing_type": null,
"__isMarketplaceListingWithDiscounts": "GroupCommerceProductItem",
"has_free_shipping_discounts": false,
"formatted_shipping_price": null,
"delivery_data": {
"carrier": null,
"delivery_address": null
},
"formatted_shipping_price_list_price_only": [],
"estimated_delivery_window": null,
"id": "1154689397205553",
"if_viewer_is_buyer": {
"__typename": "GroupCommerceProductItem",
"__isMarketplaceListingWithPDPRewrite": "GroupCommerceProductItem",
"marketplace_pdp_integrity_banner_strings_rewrite": null,
"id": "1154689397205553"
},
"story": null,
"redacted_description": {
"text": "Blue sunburst acoustic guitar is made of wood with a gloss finish. It has a Lagrima brand name on the headstock and come…"
},
"creation_time": 1795513320,
"location_text": {
"text": "Pasadena, CA"
},
"location_vanity_or_id": "105396882827337",
"is_viewer_seller": false,
"…": "104 more fields"
}Top-level fields
| Field | Type | Description |
|---|---|---|
id | string | – |
marketplace_listing_title | string | null | – |
listing_price | object | null | – |
redacted_description | object | null | – |
location_text | object | null | – |
location | object | – |
creation_time | integer | null | When it was listed, Unix seconds (UTC). |
is_sold | boolean | – |
delivery_types | string[] | – |
attribute_data | object | Condition, brand and other attributes. |
listing_photos | object[] | Photos: image.uri, image.width, image.height, accessibility_caption. |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Listing id or facebook.com/marketplace/item/<id> URL. Example: 1154689397205553. |
Errors and retries
Every error is JSON with error.code (stable: branch on it), message, hint (what to do next), docs_url and retryable. A failed call is never charged. Retry only when retryable is true, after the Retry-After header.
// fetch returns the API error as "code: hint". To retry the retryable ones
// (rate_limited, upstream_timeout), wait for Retry-After and call again:
for attempt := 0; attempt < 3; attempt++ {
page, err = fetch()
if err == nil {
break
}
time.Sleep(2 * time.Second)
}| Status | Meaning |
|---|---|
200 | The listing. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The ad, Page or advertiser is not in the Meta Ad Library. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Facebook is temporarily unavailable. Retryable; nothing was charged. |
Every error code and what to do about it.
Pricing
| Cost | |
|---|---|
| Per call | 1 credit per call |
| 1,000 calls | $1.00 on the starter pack, $0.40 at volume |
| No key (MPP or x402) | $0.01 per call |
| Failed call | Refunded, never charged |
Every response has x-credits-charged and x-credits-remaining headers. Credits never expire. Packs and calculator.
From an AI agent (MCP)
The same call is the facebook_marketplace_item tool on the hosted MCP server, so Claude, Cursor or any MCP client can make it without code. Add the server once:
claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcpThen ask for it in words (“One Facebook Marketplace listing: price, description, location, attributes, photos”), or call the tool directly:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "facebook_marketplace_item",
"arguments": {
"id": "1154689397205553"
}
}
}MCP setup for Claude Desktop, Cursor, VS Code and ChatGPT.
Enrich a search result
Call it with a listing id from the search for the full description and all photos.
Keep going
- This call in Python, JavaScript, TypeScript, PHP, cURL.
- Facebook Marketplace listing API reference: every field and status code.
- Facebook tutorials and all Go tutorials.
- Facebook API: every endpoint and price.
- How to scrape Facebook event with Go: A public Facebook event: when, venue, description, hosts, tickets, responses.
- How to scrape Facebook post with Go: A public Facebook post: message, author, attachments, reactions, comments, shares, views, top comments.
- How to scrape Facebook Ad Library search with Go: Search the Meta Ad Library by keyword: 30 ads a page with country, status, media, category, language, placement and date filters.
- How to scrape Facebook Ad Library company ads with Go: Every ad of one advertiser (Facebook Page) in the Meta Ad Library, 30 a page, filterable.
- How to scrape Facebook Ad Library advertiser search with Go: Find advertisers (Facebook Pages) in the Meta Ad Library by name.
- How to scrape Facebook Ad Library advertiser profile with Go: An advertiser’s Meta Ad Library profile: Page and Instagram details, political spend, top ad.
Run it on your own data
One key for Facebook and 76 more platforms, over REST or MCP. Free credits on signup, no card.
Facebook is a trademark of Meta Platforms, Inc. We are not affiliated with or endorsed by Meta.