Skip to content
noxstock
Guides

Build an equity agent

A minimal agent pattern for using noxstock safely and efficiently.

A good noxstock agent is selective. It gathers enough context to answer the user’s question, cites freshness and caveats, and avoids pretending that missing data is known.

System guidance

Use this instruction block in your agent:

You use noxstock for US-listed stock and ETF context. Always call /v2/search when the user gives a company name instead of a ticker. Call /v2/coverage before deep analysis. Start with /v2/snapshot. Add deeper endpoints only when needed. Treat freshness, unsupported responses, and error.retryable as part of the answer. Do not fabricate missing financial metrics, holdings, news, or analyst consensus.

Tool sequence

Simple question

User: Is AAPL expensive?
Agent:
1. /v2/coverage?symbol=AAPL
2. /v2/snapshot?symbol=AAPL
3. /v2/valuation?symbol=AAPL
4. Answer with valuation facts and freshness.

Risk question

User: What are the main risks in Tesla's latest 10-K?
Agent:
1. /v2/search?query=Tesla
2. /v2/coverage?symbol=TSLA
3. /v2/filings?symbol=TSLA&form=10-K&limit=3
4. /v2/filings/{accession}
5. /v2/filings/{accession}/section/risk_factors
6. Summarize from the filing text only.

Compare question

User: Compare NVDA, AMD, and AVGO.
Agent:
1. /v2/compare?symbols=NVDA,AMD,AVGO
2. /v2/fundamentals?symbol=<finalist>&period=quarter only if more detail is needed
3. Answer as a scorecard, not a wall of raw JSON.

Response rules

  • Mention freshness when it changes the reliability of the answer.
  • Mention unsupported and source gaps explicitly.
  • Use exact units from fields: _usd, _pct, timestamps, and periods matter.
  • Keep SEC filing summaries tied to section text; do not blend in uncited web claims.
  • Respect rate limits and back off on retryable: true errors.

Minimal JavaScript wrapper

type NoxstockError = {
  error: { code: string; message: string; retryable: boolean };
};

export async function noxstock(path: string, params: Record<string, string>) {
  const url = new URL(`https://api.noxstock.com${path}`);
  for (const [key, value] of Object.entries(params)) url.searchParams.set(key, value);

  const res = await fetch(url, {
    headers: { "X-API-Key": process.env.NOXSTOCK_API_KEY! },
  });
  const body = await res.json();

  if (!res.ok) {
    const err = body as NoxstockError;
    throw new Error(`${err.error.code}: ${err.error.message}`);
  }

  return body.data;
}