# Arrays Data Api Macro And Economics

> Guides the agent to call Arrays REST APIs for macro and economics data (treasury rates, economic indicators, CPI, GDP, unemployment, inflation, consumer sentiment, macro index/forex/commodity, VIX). Use when the user asks about macroeconomic indicators, CPI release dates, economic data announcements, interest rates, forex, commodity prices (gold GCUSD, silver SILUSD, oil CLUSD), market index data…

- **Type:** Skill
- **Install:** `agentstack add skill-arraysdata-arrays-skills-arrays-data-api-macro-and-economics`
- **Verified:** Pending review
- **Seller:** [ArraysData](https://agentstack.voostack.com/s/arraysdata)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ArraysData](https://github.com/ArraysData)
- **Source:** https://github.com/ArraysData/arrays-skills/tree/main/skills/arrays-data-api-macro-and-economics

## Install

```sh
agentstack add skill-arraysdata-arrays-skills-arrays-data-api-macro-and-economics
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Arrays Data API — Macro and Economics

**Domain**: `macro_and_economics_data`. Treasury rates, economic indicators, macro index/forex/commodity historical and real-time data, and VIX.

## Base URL and auth

- **Base**: `ARRAYS_API_BASE_URL` env var (default `https://data-tools.prd.space.id`)
- **Auth**: Send `X-API-Key: ` header on every request. Read the key from env `ARRAYS_API_KEY` or `.env` file.

## Response envelope

All endpoints return a unified JSON envelope:
```json
{ "success": true, "request_id": "...", "data": [ ... ] }
```
- `data` is **always an array** (even for single-object results).
- Access data in Python: `body["data"]`
- Always check `body["success"]` before accessing data.

## Endpoints

- **Prefix**: `/api/v1/macro/`

| Method | Path | File | Description |
|--------|------|------|-------------|
| GET | `economic-indicators` | `economic-indicators` | Economic indicators (CPI, GDP, unemployment, etc.) |
| GET | `index/historical` | `macro-index-historical` | Index historical data |
| GET | `forex/historical` | `macro-forex-historical` | Forex historical data |
| GET | `commodity/historical` | `macro-commodity-historical` | Commodity historical data |
| GET | `index/real-time` | `macro-index-real-time` | Index real-time data |
| GET | `forex/real-time` | `macro-forex-real-time` | Forex real-time data |
| GET | `commodity/real-time` | `macro-commodity-real-time` | Commodity real-time data |
| GET | `forex/symbols` | `macro-forex-symbol-list` | Available forex symbols |
| GET | `commodity/symbols` | `macro-commodity-symbol-list` | Available commodity symbols |
| GET | `treasury-rates` | `rates` | US treasury yield rates |

> For detailed parameters, response fields, and examples for a specific endpoint, read `references/.md` in this skill directory.

## Example

```python
import requests, os
base = os.environ["ARRAYS_API_BASE_URL"]
key = os.environ["ARRAYS_API_KEY"]

# Economic indicators — get US CPI
resp = requests.get(f"{base}/api/v1/macro/economic-indicators",
    params={"indicator_type": "CPI", "time_type": "CALENDAR_START_DATE",
            "start_time": 1719792000, "end_time": 1722470400},
    headers={"X-API-Key": key})
body = resp.json()
obs = body["data"][0]["observations"]  # data is array, take first element
print(obs[0]["date"], obs[0]["value"])

# Commodity historical — get gold price
resp = requests.get(f"{base}/api/v1/macro/commodity/historical",
    params={"symbol": "GCUSD", "start_time": 1746057600, "end_time": 1746057600},
    headers={"X-API-Key": key})
body = resp.json()
bars = body["data"]  # array of OHLCV bars
print(bars[0]["close"])

# Treasury rates
resp = requests.get(f"{base}/api/v1/macro/treasury-rates",
    params={"start_time": to_ts(2025, 1, 1), "end_time": to_ts(2025, 3, 1)},
    headers={"X-API-Key": key})
body = resp.json()
rates = body["data"][0]["rates"]  # nested: body["data"][0] has {"rates": [...]}
print(rates[0]["year10"])

```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ArraysData](https://github.com/ArraysData)
- **Source:** [ArraysData/arrays-skills](https://github.com/ArraysData/arrays-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: flagged — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-arraysdata-arrays-skills-arrays-data-api-macro-and-economics
- Seller: https://agentstack.voostack.com/s/arraysdata
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
