Partner-API
› Preis-Tiefpunkte › Beispiele
Beispiele: /deals
Deals einer Kategorie ab 30 Prozent, gut belegt
curl -H "X-API-Key: gw_DEIN_SCHLUESSEL" \
"https://goodsway.de/api/partner/v1/deals\
?category=Elektronik%20%26%20Technik\
&min_discount=30\
&min_points=10\
&limit=50"import requests
KOPF = {"X-API-Key": "gw_DEIN_SCHLUESSEL"}
r = requests.get(
"https://goodsway.de/api/partner/v1/deals",
headers=KOPF,
params={
"category": "Elektronik & Technik",
"min_discount": 30,
"min_points": 10,
"limit": 50,
},
timeout=30,
)
r.raise_for_status()
daten = r.json()
print(daten["total"], "Treffer insgesamt")$parameter = http_build_query([
"category" => "Elektronik & Technik",
"min_discount" => 30,
"min_points" => 10,
"limit" => 50,
]);
$ch = curl_init("https://goodsway.de/api/partner/v1/deals?" . $parameter);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: gw_DEIN_SCHLUESSEL"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$daten = json_decode(curl_exec($ch), true);
curl_close($ch);const parameter = new URLSearchParams({
category: "Elektronik & Technik",
min_discount: 30,
min_points: 10,
limit: 50,
});
const antwort = await fetch(
`https://goodsway.de/api/partner/v1/deals?${parameter}`,
{ headers: { "X-API-Key": "gw_DEIN_SCHLUESSEL" } }
);
const daten = await antwort.json();Alle Deals durchblättern
import requests, time
KOPF = {"X-API-Key": "gw_DEIN_SCHLUESSEL"}
BASIS = "https://goodsway.de/api/partner/v1/deals"
alle, offset = [], 0
while True:
r = requests.get(BASIS, headers=KOPF,
params={"limit": 500, "offset": offset}, timeout=30)
r.raise_for_status()
d = r.json()
alle.extend(d["items"])
offset += 500
if offset >= d["total"]:
break
time.sleep(0.2) # freundlich bleiben
print(len(alle), "Deals geholt")$alle = [];
$offset = 0;
do {
$ch = curl_init("https://goodsway.de/api/partner/v1/deals"
. "?limit=500&offset={$offset}");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: gw_DEIN_SCHLUESSEL"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$d = json_decode(curl_exec($ch), true);
curl_close($ch);
$alle = array_merge($alle, $d["items"]);
$offset += 500;
usleep(200000);
} while ($offset < $d["total"]);const KOPF = { "X-API-Key": "gw_DEIN_SCHLUESSEL" };
let alle = [], offset = 0, total = Infinity;
while (offset < total) {
const r = await fetch(
`https://goodsway.de/api/partner/v1/deals?limit=500&offset=${offset}`,
{ headers: KOPF }
);
const d = await r.json();
total = d.total;
alle = alle.concat(d.items);
offset += 500;
await new Promise(w => setTimeout(w, 200));
}