FUCK PARSER API Взять ключ

Свежие объявления с телефонами, сразу в твой скрипт

Фильтры как в боте, в ответ объявления с телефонами продавцов. Каждый следующий запрос отдаёт только новое.

Собрать скриптДокументация

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"
    }
  ]
}

Как начать

  1. Возьми ключ

    В @fuckparserbot нажми «🔑 API» в главном меню и скопируй ключ, он начинается с fp_.

  2. Изучи документацию

  3. Запусти скрипт

    Создаёт задачу и забирает новое, пока она не закончится. Фильтры в 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()
    

Площадки