# AAII — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access weekly AAII Investor Sentiment Survey data tracking how individual investors feel about stock market direction — bullish, neutral, or bearish. Covers current readings, historical trends dating back to 1987, and state-by-state breakdowns.

**Category:** Finance & Markets | **Website:** [aaii.com/](https://aaii.com/) | **Docs:** [parse.bot/marketplace/fd220a6b-fcc3-47f5-99c5-723c27d3f4ff/aaii-com-api](https://parse.bot/marketplace/fd220a6b-fcc3-47f5-99c5-723c27d3f4ff/aaii-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/aaii/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get current sentiment

Retrieves the latest AAII investor sentiment survey snapshot. Returns the current week's bullish/neutral/bearish percentages, the last 4 weeks of data, live vote percentages (updated in real-time as members vote), long-term historical averages, 1-year sentiment highs, the weekly special question with answer breakdown, and a link to the latest commentary article. Data refreshes each Thursday when the new survey closes.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/aaii/get-current-sentiment \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get historical sentiment

Retrieves approximately 52 weeks of historical AAII sentiment data. Each week includes bullish/neutral/bearish percentages, running averages for bullish and bearish, and the bull-bear spread (bullish minus bearish). Useful for trend analysis, contrarian signals, and charting sentiment over one year. No input parameters required; the endpoint always returns the most recent year of weekly readings.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/aaii/get-historical-sentiment \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get state sentiment

Retrieves the state-by-state breakdown of investor sentiment for the current survey period. Returns bullish/neutral/bearish percentages for each US state and territory that has sufficient survey responses. Coverage varies week to week; typically 40-50 states report. Useful for identifying regional sentiment divergences from the national average.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/aaii/get-state-sentiment \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.