Свежие объявления с телефонами, сразу в твой скрипт
Фильтры как в боте, в ответ объявления с телефонами продавцов. Каждый следующий запрос отдаёт только новое.
import requests
API = "https://api.fuck-api.xyz"
HEADERS = {"X-API-Key": "fp_ВАШ_КЛЮЧ"}
BODY = {
"platform": "gumtree",
"filters": {
"query": "iphone 13",
"price": [100, 500],
"with_phone": True,
},
}
task = requests.post(
f"{API}/v1/tasks",
json=BODY, headers=HEADERS, timeout=40,
).json()["task"]
ads = requests.get(
f"{API}/v1/tasks/{task['id']}/ads",
params={"wait": 20}, headers=HEADERS, timeout=40,
).json()["ads"]
Что придёт в ads, сокращённо:
{
"ads": [
{
"title": "iPhone 13 128 GB",
"price": 340,
"currency": "EUR",
"phone": "+4915100000000",
"url": "https://www.gumtree.com/ad/2384712650",
"published_at": "2026-10-20T19:48:51Z"
}
]
}
Как начать
-
Возьми ключ
В @fuckparserbot нажми «🔑 API» в главном меню и скопируй ключ, он начинается с
fp_. -
Изучи документацию
-
Запусти скрипт
Создаёт задачу и забирает новое, пока она не закончится. Фильтры в
BODYсобирает страница площадки.import time import requests API = "https://api.fuck-api.xyz" HEADERS = {"X-API-Key": "fp_ВАШ_КЛЮЧ"} BODY = { "platform": "gumtree", "filters": { "query": "iphone 13", "price": [100, 500], "with_phone": True, }, "limit": 200, } def show(ad): print(ad.get("title"), ad.get("price"), ad.get("currency", ""), ad.get("phone", "без телефона"), ad.get("url")) def ask(method, path, **given): while True: try: response = requests.request(method, f"{API}{path}", headers=HEADERS, timeout=40, **given) except requests.RequestException: return None if response.status_code not in (429, 503): return response time.sleep(int(response.headers.get("Retry-After", 5))) def lost(response): return response is None or response.status_code >= 500 def main(): response = ask("POST", "/v1/tasks", json=BODY) while lost(response): time.sleep(5) response = ask("POST", "/v1/tasks", json=BODY) answer = response.json() if response.status_code != 200: print(answer["error"]["code"], answer["error"]["message"]) return if "notice" in answer: print(answer["notice"]["message"]) return path = f"/v1/tasks/{answer['task']['id']}/ads" repeat = False while True: response = ask("GET", path, params={"wait": 20, "repeat": 1} if repeat else {"wait": 20}) if lost(response): repeat = True time.sleep(5) continue answer = response.json() if response.status_code != 200: print(answer["error"]["code"], answer["error"]["message"]) return repeat = False for ad in answer["ads"]: show(ad) if answer["task"]["status"] == "done" and not answer["ads"]: print("Задача закончилась:", answer["task"].get("reason")) return time.sleep(5) main()
Площадки
- Vintedvinted.com
- Wallapopwallapop.com
- Depopdepop.com
- Gumtreegumtree.com
- OLXolx.pl
- Kleinanzeigenkleinanzeigen.de
- Quokaquoka.de
- Willhabenwillhaben.at
- Ländleanzeigerlaendleanzeiger.at
- Marktplaatsmarktplaats.nl
- 2dehands2dehands.be
- 2ememain2ememain.be
- Leboncoinleboncoin.fr
- Subitosubito.it
- Milanunciosmilanuncios.com
- Jófogásjofogas.hu
- Ricardoricardo.ch
- Mercarimercari.com
- OfferUpofferup.com
- Poshmarkposhmark.com
- Kijijikijiji.ca
- Finnfinn.no
- Toritori.fi
- Dbadba.dk
- Beebsbeebs.app
- Andelemandeleandelemandele.lv
- KupujemProdajemkupujemprodajem.com
- Reverbreverb.com
- Bazošbazos.cz