Skip to content

Instantly share code, notes, and snippets.

@bugb
Created December 27, 2023 09:59
Show Gist options
  • Save bugb/c370ed474e49a6e937f4563dec4c5574 to your computer and use it in GitHub Desktop.
Save bugb/c370ed474e49a6e937f4563dec4c5574 to your computer and use it in GitHub Desktop.
Get current P2P trading ads
import requests


headers = {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, br",
    "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
    "Cache-Control": "no-cache",
    "Connection": "keep-alive",
    "Content-Length": "123",
    "content-type": "application/json",
    "Host": "p2p.binance.com",
    "Origin": "https://p2p.binance.com",
    "Pragma": "no-cache",
    "TE": "Trailers",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0",
}
data = {
    "asset": "USDT",
    "fiat": "VND",
    "merchantCheck": True,
    "page": 1,
    "payTypes": ["BANK"],
    "publisherType": None,
    "rows": 20,
    "tradeType": "SELL",
    "transAmount":  "5000000",
}
r = requests.post('https://p2p.binance.com/bapi/c2c/v2/friendly/c2c/adv/search', headers=headers, json=data)
print(r.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment