Suede
Auf dieser Seite

Shopping-Suche

Shopping-Suchergebnisse (Produkte) als JSON.

TEXT
GET /v1/shopping

Erfordert einen gültigen API-Schlüssel, eine aktive Mitgliedschaft und verfügbares API-Guthaben.

Suchparameter

Name Typ Erforderlich Vorgabe Beschreibung
q string ja Die Suchanfrage (ein Produkt oder eine Kategorie).
safe string nein on Stufe der sicheren Suche: off oder on.
gl string nein (auto) Zweibuchstabiger Regions-/Ländercode (z. B. us, gb) — beeinflusst Preise/Händler.
hl string nein (auto) Zweibuchstabiger Sprachcode (z. B. en, es).
time string nein any Aktualitätsfilter: any, hour, day, week, month, year.
num integer nein (Anbietervorgabe) Gewünschte Ergebnisanzahl. Auf 5–100 begrenzt (außerhalb des Bereichs → 20).

Antwort

JSON
{
  "query": "wireless headphones",
  "kind": "shopping",
  "results": [
    {
      "title": "Acme Wireless Headphones",
      "url": "https://shop.example.com/p/acme-wh",
      "description": "Over-ear, 40-hour battery…",
      "thumbnail": "https://shop.example.com/p/acme-wh/thumb.jpg",
      "price": "$129.99",
      "meta": "Example Store",
      "extra": null
    }
  ]
}
Feld Typ Beschreibung
query string Die ausgeführte Suchanfrage.
kind string Für diesen Endpunkt stets shopping.
results[].title string Titel des Produkts.
results[].url string URL der Produktseite.
results[].description string | null Produktbeschreibung, sofern verfügbar.
results[].thumbnail string | null URL des Produktbildes.
results[].price string | null Formatierter Preis, sofern verfügbar.
results[].meta string | null Händler / Quelle.
results[].extra string | null Wird für Shopping in der Regel nicht verwendet.

Beispiele

cURL
curl -G "https://api.suede.io/v1/shopping" \
  -H "Authorization: Bearer $SUEDE_API_KEY" \
  --data-urlencode "q=wireless headphones" \
  --data-urlencode "gl=us"
C#
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new("Bearer", Environment.GetEnvironmentVariable("SUEDE_API_KEY"));
var url = "https://api.suede.io/v1/shopping?q=" + Uri.EscapeDataString("wireless headphones") + "&gl=us";
Console.WriteLine(await http.GetStringAsync(url));
JavaScript
const params = new URLSearchParams({ q: "wireless headphones", gl: "us" });
const res = await fetch(`https://api.suede.io/v1/shopping?${params}`, {
  headers: { Authorization: `Bearer ${process.env.SUEDE_API_KEY}` },
});
const data = await res.json();
for (const r of data.results) console.log(`${r.title}: ${r.price} (${r.meta})`);
War diese Seite hilfreich?