Xueqiu Stock Quote Access: Expired Cookies Return Silent Empty Data
A developer explains how to pull China stock quotes from Xueqiu (Snowball) using Python. The platform's quote endpoint needs an xq_a_token cookie that the homepage sets, and without it the request fails with a 400 error. When that cookie expires, the site returns HTTP 200 with an empty array instead of an error, which can quietly pass monitoring checks. The author recommends raising an exception on empty quote data so broken sessions are not stored as missing symbols. Batch requests are also covered, with the author chunking symbols at 20 per call to limit the impact of a single bad ticker.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in