Observed since 21 Oct, 09:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Overseas HTTP client for AGuAlpha Investment Platform (UK deployment)
A Python library for accessing the AGuAlpha Investment Platform via the
UK (eu-west-1) deployment at https://agualpha.com/api/.
Which package should I use?
agualpha(this one) — points tohttps://agualpha.com/api. Use this if you or your customers cannot reach the.cndomain (e.g. clients outside mainland China).agualphacn— points tohttps://www.agualpha.cn/api. Use this for domestic (mainland China) deployments.Both packages expose the same public API (
AGuAlphaClient,AGuAlphaAsyncClient, identical method signatures). Only the defaultbase_urldiffers.
pip install agualpha
For async support:
pip install agualpha[async]
For pandas integration:
pip install agualpha[pandas]
Set your API key as an environment variable (recommended over passing it in code):
export AGUALPHA_API_KEY="sk-your-api-key-here"
Optional overrides:
# Point the client at a non-default gateway (e.g. staging).
export AGUALPHA_BASE_URL="https://agualpha.com/api"
No credentials other than the API key are required — the gateway handles database access on its side.
from agualpha import AGuAlphaClient
with AGuAlphaClient(api_key="sk-your-api-key-here") as client:
positions = client.get_positions(start_date="2025-01-01")
for p in positions.data:
print(p.date, p.outstanding, p.value)
import asyncio
from agualpha import AGuAlphaAsyncClient
async def main():
async with AGuAlphaAsyncClient(api_key="sk-...") as client:
rows = await client.get_adj_close(
membership="csi300",
start_date="2025-01-01",
end_date="2025-12-31",
)
print(f"{len(rows)} rows")
asyncio.run(main())
All methods mirror agualphacn exactly. List-returning methods
auto-paginate when page=None (the default); pass page=int for a
single page.
| Method | Returns | Tier | Notes |
|---|---|---|---|
get_positions(...) | PositionsResponse | standard | date filter optional |
get_ideas(...) | IdeasResponse | standard | status / direction optional |
get_csi_weights(index=..., ...) | list[dict] | VIP | index required |
get_revision_fy2(...) | list[dict] | VIP | date filter required |
get_adj_close(membership=..., ...) | list[dict] | VIP | membership + date required, supports cursor |
get_p_cies(zone=...) | list[dict] | VIP | zone required ("hk" or "cn") |
get_sp_rolling_index(...) | list[dict] | VIP | at least one filter required |
get_sp_rolling_index_products() | list[str] | VIP | no params |
get_limit_evts(...) | list[dict] | VIP | date filter required |
Each list method has a _dataframe variant (get_csi_weights_dataframe,
etc.) that returns a pandas.DataFrame.
A agualpha console-script is provided for quick one-off queries:
agualpha --api-key sk-... positions --start-date 2025-01-01
agualpha adj-close --membership csi300 --start-date 2025-01-01 --end-date 2025-12-31
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.1 | 16 Sept 2026 | 6 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:206bd8c8a706fdb2a7153a378de4c0311adf3547c9d2282431919403b3947a1e