Skip to main content

goofish-xianyu-api — Goofish (Xianyu / 闲鱼) Search, Seller Inventory & Reviews Python SDK

UnitBytes Goofish Xianyu Seller Inventory & Reviews Scraper

PyPI Python 3.10+ License: MIT

Disclaimer: Independent integration powered by UnitBytes; not affiliated with or endorsed by Alibaba Group, 1688.com, or Goofish/Xianyu.

goofish-xianyu-api is a typed Python SDK and CLI (goofish-xianyu / goofish-scrape) for Goofish / Xianyu (闲鱼) secondhand & luxury resale intelligence — including keyword search, m.tb.cn mobile share-link resolution, listing details, seller storefront inventory (onsale & sold), buyer reviews, CNY-to-USD markdown math, and Zhima Credit (芝麻信用) seller trust scoring — with zero Taobao/Alipay cookies required.


Why Use goofish-xianyu-api?

  • Zero Login / Zero Cookie Churn / Zero Mandatory Dependencies — Pure Python stdlib HTTP client (0 required third-party packages); no +86 SMS verification, Alipay QR login, or local proxy rotation to maintain.
  • Multi-Provider Cloud Routing (apify • unitbytes • rapidapi) — Auto-detects APIFY_TOKEN (warm Apify Standby HTTP + batch fallback), UNITBYTES_API_KEY (https://api.unitbytes.com/v1/goofish/*), or RAPIDAPI_KEY (https://goofish-xianyu-marketplace-and-seller-api.p.rapidapi.com/v1/goofish/*) with zero code changes.
  • Multi-Keyword Watchlist Sniper (search_many + only_new) — Deduplicate across multiple keywords by canonical itemId and persist seen listings in an atomic local JSON state file so cron jobs alert only on newly listed deals.
  • Offline English → Xianyu Slang Glossary (0 LLM Calls) — Translate English product terms, ACG guzi merch (badge → 吧唧, plush → 棉花娃娃, acrylic stand → 立牌), and Xianyu condition shorthand (box and papers → 箱说全, unopened → 全新未拆封) offline while preserving model numbers ("Sony A7M4 mirrorless camera" → "索尼 A7M4 微单相机").
  • Cross-Border Proxy-Agent Links Built In — Generate ready-to-open Superbuy, AllChinaBuy, Sugargoo, CSSBuy, and Basetao order URLs (build_proxy_agent_links) alongside CNY-to-USD markdown math (analyze_resale_pricing) and 0–100 Zhima Credit (芝麻信用) seller trust scoring (assess_seller_trust).

Quickstart

1. Install

pip install goofish-xianyu-api

2. Configure Your Free Starter API Token

Create a free Apify account ($5/month recurring platform credit included — no credit card required) and copy your APIFY_TOKEN:

export APIFY_TOKEN="apify_api_YOUR_TOKEN"
# Or use UnitBytes Direct Cloud API / RapidAPI with zero code changes:
# export UNITBYTES_API_KEY="ub_live_YOUR_KEY"
# export RAPIDAPI_KEY="YOUR_RAPIDAPI_KEY"

3. Zero-Login Live Keyword Search, Watchlist Deal Sniper & Seller Zhima Audit

from goofish_xianyu_api import (
    GoofishClient,
    analyze_resale_pricing,
    assess_seller_trust,
    build_proxy_agent_links,
    translate_keyword,
)

client = GoofishClient()  # Reads APIFY_TOKEN automatically

# 1) Offline English -> Simplified Chinese Xianyu slang translation (0 network calls)
print(translate_keyword("Sony A7M4 mirrorless camera box and papers"))
# -> "索尼 A7M4 微单相机 箱说全"
print(translate_keyword("Genshin Impact badge unopened"))
# -> "原神 吧唧 全新未拆封"

# 2) Multi-keyword watchlist sniper with cross-keyword itemId dedup & persistent state
new_deals = client.search_many(
    ["Sony A7C2 mirrorless", "Fujifilm X100VI box and papers", "Nintendo Switch OLED"],
    max_items=45,                  # Auto-paginates warm Standby pages (>30 items)
    translate_keywords=True,       # Translates English terms into Chinese Xianyu slang
    personal_only=True,            # Filter out commercial storefronts (个人闲置)
    free_shipping=True,
    price_min=1000,
    price_max=13500,
    sort_by="newest",
    only_new=True,                 # Emit only unseen itemIds across cron runs
    state_file="watchlist_state.json",
)

for item in new_deals[:5]:
    pricing = analyze_resale_pricing(item, cny_to_usd=0.138)
    agents = build_proxy_agent_links(item)
    print(
        f"[{item.get('matchedKeyword')}] {item['title']} -> "
        f"¥{pricing.price_cny} (${pricing.price_usd}, -{pricing.discount_pct}%)"
    )
    print(f"  Superbuy:    {agents.superbuy}")
    print(f"  AllChinaBuy: {agents.allchinabuy}")

# 3) Resolve a raw Xianyu mobile share snippet or numeric item ID
detail = client.get_item_detail("【闲鱼】https://m.tb.cn/h.5xyz123 点击链接直接打开")

# 4) Audit seller Zhima Credit, KYC verification badges & negative buyer feedback
profile = client.get_seller_profile("2214891234567")
trust = assess_seller_trust(profile)
print(f"Trust Score: {trust.trust_score}/100 | Zhima: {trust.zhima_tier} | Risk: {trust.risk_level}")

sold_comps = client.get_seller_items("2214891234567", status="sold", max_items=20)
neg_reviews = client.get_seller_reviews("2214891234567", review_filter="negative_only", max_reviews=20)

Command-Line Interface (goofish-xianyu / goofish-scrape)

Export Goofish resale listings (enriched automatically with resaleSummary and proxyAgentLinks), seller profiles, and reviews to json, jsonl, or csv:

# Multi-keyword English -> Chinese watchlist sniper (persists unseen IDs in seen_deals.json)
goofish-xianyu --format jsonl search \
  --keywords "Sony A7C2 mirrorless" "Pokemon card unopened" \
  --translate \
  --personal-only \
  --max-items 40 \
  --only-new seen_deals.json

# Search personal sellers and export USD markdowns + Superbuy/AllChinaBuy columns to CSV
goofish-xianyu --format csv --output deals.csv search "爱马仕 picotin" --personal-only --max-items 20

# Inspect a single listing (supports raw m.tb.cn share links)
goofish-xianyu --format json item "https://www.goofish.com/item?id=837465918273"

# Audit a seller's Zhima Credit + trust score
goofish-xianyu --format json seller 2214891234567 --include-items --include-reviews

# Export a seller's historical sold comps as JSONL
goofish-scrape --format jsonl seller-items 2214891234567 --status sold --max-items 20

Direct Apify Actor JSON Input Compatibility

When triggering unitbytes/goofish-xianyu-search-scraper directly via REST, n8n, or prefer_standby=False, pass multi-keyword queries as a comma-separated string in keyword ("keyword": "索尼 A7C2, 富士 X100VI, Switch OLED"). GoofishClient.search_many(..., prefer_standby=False) formats this automatically.


Upstream Actors & Pricing

Capability Apify Actor Slug Landing Page Pay-Per-Event Pricing
Keyword Search & Listing Detail unitbytes/goofish-xianyu-search-scraper unitbytes.com/actors/goofish-xianyu-search-scraper $0.002 search / $0.003 detail
Seller Profile, Inventory (onsale/sold) & Reviews unitbytes/goofish-scraper unitbytes.com/actors/goofish-xianyu-seller-scraper $0.004 profile / $0.0035 item / $0.001 review

Realistic Scope & Upstream Boundaries

  • Works Reliably Without Login: Public Goofish keyword search, CNY price & personal-seller filters, m.tb.cn share-link resolution, full item descriptions & HD galleries, seller Zhima Credit tier (极好/优秀/良好), KYC verification badges (实人认证/实名认证), active & sold storefront inventory, and buyer feedback ratings.
  • Upstream Platform Boundaries: Private buyer-seller chat messages, direct Alipay phone/account identifiers, and order checkout actions require an authenticated personal Goofish mobile app session and are outside the scope of public guest data extraction.

  • Extracts publicly available marketplace listing & seller reputation metadata only.
  • Independent integration powered by UnitBytes; not affiliated with or endorsed by Alibaba Group, 1688.com, or Goofish/Xianyu.
  • Licensed under the MIT License.

Metadata

Release files for goofish-xianyu-api 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for goofish-xianyu-api 1.0.0
File Size Uploaded Provenance Actions
goofish_xianyu_api-1.0.0.tar.gz 37.4 kB Without provenance Details for goofish_xianyu_api-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for goofish-xianyu-api 1.0.0
File Interpreter ABI Platform Actions
goofish_xianyu_api-1.0.0-py3-none-any.whl Python 3 none any Details for goofish_xianyu_api-1.0.0-py3-none-any.whl

Total release size: 67.7 kB

Release files / goofish_xianyu_api-1.0.0.tar.gz

Download URL goofish_xianyu_api-1.0.0.tar.gz
Size 37.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8c340709ba3c0f990eeef8c64021689d67e81f8018f22518e21d8988a1581f34
BLAKE2b-256 checksum
How to use checksums
e646941b40af09df777b2e2d626575a9aa34b556e7ba0dddd50047b8da087840
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / goofish_xianyu_api-1.0.0-py3-none-any.whl

Download URL goofish_xianyu_api-1.0.0-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2d39c4249c0979813c0cfda1761e91ccd657aca43c19a9444f524b6f8c7b783
BLAKE2b-256 checksum
How to use checksums
7c12a64c436ced4eac58d7eebc66e6323bfaac98ee4ef0d9c1974366984489df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for goofish-xianyu-api 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page