Huangjinjiage APIhuangjinjiage.cn ↗
Access real-time gold, silver, platinum, and oil prices from huangjinjiage.cn. Covers international spot prices, Chinese domestic markets, brand jewelry, and city-level fuel data.
What is the Huangjinjiage API?
The huangjinjiage.cn API exposes 8 endpoints covering gold, silver, platinum, palladium, and oil prices across Chinese domestic and international markets. get_city_oil_prices returns all gasoline and diesel grades (89#, 92#, 95#, 98# petrol; 0#, -10#, -20#, -35# diesel) in yuan/liter for any Chinese city supplied by pinyin, while other endpoints cover brand jewelry prices for 12 major Chinese retailers, Hong Kong gold prices, and COMEX and London spot benchmarks.
curl -X GET 'https://api.parse.bot/scraper/608a4f46-c87f-43bf-ad87-30196f433d92/get_city_oil_prices?city_pinyin=beijing' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace huangjinjiage-cn-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Gold & Oil Price Tracker SDK — bounded, re-runnable."""
from parse_apis.gold___oil_price_tracker__huangjinjiage_cn_ import (
GoldOilPrices,
CityNotFound,
)
client = GoldOilPrices()
# International crude oil prices — Brent and WTI
for oil in client.crudeoilprices.list(limit=5):
print(oil.name, oil.price, oil.unit, f"change={oil.change}")
# Drill into a specific city's fuel prices
city = client.cityoilprices.get(city_pinyin="beijing")
print(city.region, "92#:", city.prices.gasoline_92, "95#:", city.prices.gasoline_95)
# National oil overview — pick first region and get full details
region = client.regionaloilprices.list(limit=1).first()
if region:
detail = region.details()
print(region.region, "detail diesel_0:", detail.prices.diesel_0)
# International gold snapshot — singleton fetch
gold = client.internationalgoldsnapshots.current()
print(gold.london_gold.name, gold.london_gold.price, gold.exchange_rate.price)
# Brand gold prices — iterate top brands
for brand in client.brandgoldprices.list(limit=3):
print(brand.brand, brand.prices[0].product, brand.prices[0].price)
# Typed error: catch a city that doesn't exist
try:
client.cityoilprices.get(city_pinyin="nonexistentcity")
except CityNotFound as exc:
print(f"City not found: {exc.city_pinyin}")
print("exercised: crudeoilprices.list / cityoilprices.get / regionaloilprices.list+details / internationalgoldsnapshots.current / brandgoldprices.list")
Fetches today's oil prices for a specific Chinese city or province by pinyin. Returns all available gasoline grades (89#, 92#, 95#, 98#) and diesel grades (0#, -10#, -20#, -35#) in yuan/liter. Empty string indicates price unavailable for that grade.
| Param | Type | Description |
|---|---|---|
| city_pinyin | string | City or province name in pinyin (e.g., beijing, shanghai, guangdong, sichuan, chongqing, dongguan). |
{
"type": "object",
"fields": {
"prices": "object with gasoline_89, gasoline_92, gasoline_95, gasoline_98, diesel_0, diesel_neg_10, diesel_neg_20, diesel_neg_35 (yuan/liter, empty string if unavailable)",
"region": "string, the city_pinyin value"
},
"sample": {
"data": {
"prices": {
"diesel_0": "8.09",
"gasoline_89": "",
"gasoline_92": "8.35",
"gasoline_95": "8.89",
"gasoline_98": "10.39",
"diesel_neg_10": "8.57",
"diesel_neg_20": "8.98",
"diesel_neg_35": ""
},
"region": "beijing"
},
"status": "success"
}
}About the Huangjinjiage API
International and Domestic Precious Metal Prices
get_international_gold_prices returns a snapshot of London spot gold and silver, COMEX gold and silver futures, and the current USD/CNY exchange rate. Each instrument includes price, high, low, yesterday_close, change, and update_time. get_domestic_gold_prices covers the Shanghai Gold Exchange's T+D contract, Silver T+D, and AU9999 (when market data is available), with prices in CNY/gram for gold and CNY/kg for silver.
Brand Jewelry and Recycling Prices
get_brand_gold_prices returns today's per-gram jewelry prices for 12 named Chinese brands including 周大福, 老凤祥, 中国黄金, and 菜百首饰. Each entry carries the brand name and an array of product/price/time objects. get_gold_recycling_prices returns buyback rates for 24k, 22k, 18k, and 14k gold, as well as 999 platinum, 999 palladium, and 999 silver — each with type, price (yuan/gram), purity, and time. get_hong_kong_gold_prices covers the same major brands for the Hong Kong market with prices in both HKD/tael and HKD/gram.
Oil Prices by City and National Overview
get_city_oil_prices accepts a city_pinyin parameter (e.g., beijing, chongqing, dongguan) and returns prices for up to eight fuel grades. An empty string in the response indicates that grade is unavailable in that region. get_national_oil_prices_overview returns an array of all provinces and cities with 92#, 95#, 98# gasoline and 0# diesel prices — useful for building a full national fuel price table without iterating individual city calls.
International Crude Oil
get_international_oil_prices returns Brent and WTI crude oil prices in USD/barrel, including price, change from yesterday's close, and update_time. The response is an array of contract objects, so additional contracts can appear without a schema change.
The Huangjinjiage API is a managed, monitored endpoint for huangjinjiage.cn — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when huangjinjiage.cn changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official huangjinjiage.cn API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display city-by-city fuel costs for a Chinese logistics or fleet management dashboard using
get_city_oil_priceswith pinyin city names. - Track the spread between COMEX gold futures and Shanghai AU9999 spot prices by combining
get_international_gold_pricesandget_domestic_gold_prices. - Aggregate brand jewelry pricing across 12 major Chinese retailers using
get_brand_gold_pricesto power a consumer comparison tool. - Monitor gold and platinum recycling rates via
get_gold_recycling_pricesfor pawn shop or buyback pricing apps. - Build a national fuel price map using
get_national_oil_prices_overviewto populate all provinces in a single request. - Compare Hong Kong and mainland jewelry prices by pairing
get_hong_kong_gold_priceswithget_brand_gold_prices. - Alert traders to Brent-WTI spreads by polling
get_international_oil_pricesfor both contracts.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does huangjinjiage.cn offer an official developer API?+
What does `get_city_oil_prices` return when a fuel grade isn't available in a given region?+
Does the API include historical gold or oil price data?+
Are palladium spot prices or futures available beyond the recycling buyback rate?+
get_gold_recycling_prices, which returns a CNY/gram buyback rate for 999 palladium. Live palladium spot or futures data is not covered. You can fork this API on Parse and revise it to add an endpoint for live palladium spot pricing.