| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- # -*- coding: utf-8 -*-
- # Author : Charley
- # Python : 3.10.8
- # Date : 2025/10/30 14:56
- import requests
- import json
- headers = {
- "accept": "application/json, text/plain, */*",
- "content-type": "application/json",
- "referer": "https://www.tcgplayer.com/",
- "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"
- }
- url = "https://mp-search-api.tcgplayer.com/v1/search/request"
- params = {
- "q": "",
- "isList": "false",
- "mpfev": "4448"
- }
- data = {
- "algorithm": "sales_dismax",
- "from": 4776,
- "size": 24,
- "filters": {
- "term": {
- "productLineName": [
- "magic"
- ],
- "setName": [
- "the-list-reprints"
- ],
- "productTypeName": [
- "Cards"
- ]
- },
- "range": {},
- "match": {}
- },
- "listingSearch": {
- "context": {
- "cart": {}
- },
- "filters": {
- "term": {
- "sellerStatus": "Live",
- "channelId": 0
- },
- "range": {
- "quantity": {
- "gte": 1
- }
- },
- "exclude": {
- "channelExclusion": 0
- }
- }
- },
- "context": {
- "cart": {},
- "shippingCountry": "CN",
- "userProfile": {}
- },
- "settings": {
- "useFuzzySearch": True,
- "didYouMean": {}
- },
- "sort": {}
- }
- data = json.dumps(data, separators=(',', ':'))
- response = requests.post(url, headers=headers, params=params, data=data)
- print(response.text)
- print(response)
|