# How to use an agent to research a company before earnings

> Build a useful pre-earnings brief with search and filings libraries: find the latest reports, revisit the prior call, and decide what to watch next.

- Canonical URL: https://www.searchforagents.com/blog/how-to-use-an-agent-to-research-a-company-before-earnings
- Author: Mara Finch, Industry writer
- Published: 2026-09-25
- Updated: 2026-09-25
- Topic: Finance
- Review due: 2026-12-25

## Direct answer

Give the agent a company, fiscal period, and research question. Use search to discover filing passages, a filing library to locate the latest official report, a finance-search tool for prior earnings context, and web search for investor-relations pages. Ask for a dated brief that separates filed facts, management statements, and open questions.

## Key takeaways

- Start with a question about the next report, not an instruction to predict a stock price.
- Combine filing-passage discovery, official filing history, prior-call context, and investor-relations announcements.
- Turn what you find into a brief with dated facts, management statements, and questions the next report can answer.

The useful question before an earnings release is not “Will the stock go up?” It is “What do I know about this business, what did management say last time, and what would change my understanding when the next numbers arrive?” An agent can assemble that briefing from several search and data APIs without pretending to know the result in advance.

Take **Apple before its next earnings announcement** as a worked example. Give the agent the company name, ticker **AAPL**, [SEC](https://www.sec.gov) CIK **0000320193**, and an as-of date. Ask it to investigate Services growth and management's latest comments. These are **library examples based on published SDK documentation**, not the results of a live four-provider test; account access, available transcripts, event dates, and returned records must be checked when you run them. Search for Agents is produced by [Valyu](https://valyu.ai), which is one of the four providers discussed here.

The examples use TypeScript; install the documented packages with `npm install valyu-js sec-edgar-toolkit @perplexity-ai/perplexity_ai exa-js`. Set `VALYU_API_KEY`, `PERPLEXITY_API_KEY`, and `EXA_API_KEY` in your environment. [SEC](https://www.sec.gov) access needs a real contact identity in `SEC_IDENTITY`, as described below. Run the examples in a server-side TypeScript environment so credentials remain private.

## 1. Find the questions worth asking

[Valyu](https://valyu.ai)'s [Search API](https://docs.valyu.ai/api-reference/endpoint/search.md) accepts a natural-language `query`; its [finance sources](https://docs.valyu.ai/use-cases/finance) include [SEC](https://www.sec.gov) filings and earnings datasets. Search a filing section rather than asking the agent to summarize “everything about Apple.” With a subscription that includes the filing dataset, the [TypeScript SDK](https://docs.valyu.ai/sdk/typescript-sdk/search) can search as follows:

```typescript
import { Valyu } from "valyu-js";

const results = await new Valyu().search(
  "Apple latest filed 10-Q Services revenue and management discussion",
  {
    searchType: "proprietary",
    includedSources: ["valyu/valyu-sec-filings"],
    maxNumResults: 5,
    responseLength: "medium",
  },
);
if (!results.success) throw new Error("Filing search did not complete");
for (const hit of results.results) {
  console.log(hit.title, hit.url, hit.content.slice(0, 500));
}
```

Read the returned filing titles, URLs and passages. Ask the agent to make a list of *candidate* questions: Did Services growth change? Which products or regions does management say drove the quarter? Did it describe risks that might matter next quarter? Then open the filing for the lines that actually answer each question. Inspect the response status and warnings if some sources fail; a partial result is not proof that nothing else was filed. The finance dataset requires a [Valyu](https://valyu.ai) subscription; the SDK's `searchType` selects **`proprietary`**, not a nonexistent `finance` mode. If you want only public-web discovery, run a separate `web` search.

## 2. Establish the filed baseline

The [SEC](https://www.sec.gov) provides [EDGAR filing histories](https://www.sec.gov/search-filings/edgar-application-programming-interfaces), but does not publish an official TypeScript SDK. The independent [SEC EDGAR Toolkit](https://github.com/stefanoamorelli/sec-edgar-toolkit) offers typed `Company` and `Filing` objects. Set `SEC_IDENTITY` to an application name and your real contact email, as required for automated [SEC](https://www.sec.gov) access. Its filings collection is newest first, so you can select the latest report **filed by the briefing date**:

```typescript
import { Company, setIdentity } from "sec-edgar-toolkit";

const identity = process.env.SEC_IDENTITY;
if (!identity) throw new Error("Set SEC_IDENTITY to your real contact");
setIdentity(identity);
const apple = await Company.lookup("AAPL");
const filings = await apple.getFilings({ form: ["10-Q", "10-K"], limit: 20 });
const filing = filings.find((item) => item.filingDate <= "2026-09-25");
if (!filing) throw new Error("No prior 10-Q or 10-K found");
console.log(filing.formType, filing.filingDate, filing.periodOfReport);
console.log(filing.accessionNumber, filing.url);
const filingText = await filing.text();
console.log(filingText.includes("Services"));
```

The `filingDate` tells the agent when the report became public; `periodOfReport` identifies the period covered. `filing.text()` yields readable text, while `filing.url` points to the [SEC](https://www.sec.gov) filing index where a reader can open the original report and check the table units. The `limit: 20` sample is only a recent window: expand the search if the as-of date is older. The toolkit is **independently maintained**; it does not speak for the [SEC](https://www.sec.gov) or certify a number inside a filing. A prior filing may not contain a date for the *next* call; confirm upcoming events through the company's investor-relations channel.

For a concrete historical baseline, Apple's [fiscal 2025 10-K](https://www.sec.gov/Archives/edgar/data/320193/000032019325000079/aapl-20250927.htm), filed **31 October 2025**, reports **Services net sales of 109,158 in a table labeled dollars in millions**: $109.158 billion for that fiscal year. That figure supplies a precise, dated reference for a Services question; it is **not** a current-quarter figure or a prediction of the next release. The [industry-search source check](/blog/how-to-verify-search-results-across-finance-biomedical-and-law) shows why the agent must keep those periods separate. [EDGAR](https://www.sec.gov)'s data APIs do not need an API key, but automated requests should comply with the [SEC](https://www.sec.gov)'s access policy; `data.sec.gov` does not provide browser CORS support.

## 3. Revisit prior earnings

Numbers in a filing tell only part of the story. [Perplexity](https://www.perplexity.ai)'s [Agent API `finance_search` tool](https://docs.perplexity.ai/docs/agent-api/tools/finance-search) can look up the last available earnings call, segment figures, and management's discussion for a company. The [TypeScript SDK](https://docs.perplexity.ai/docs/agent-api/quickstart) lets you ask a targeted question. Its documented direct-model configuration sets `max_steps` to at least 3 so the tool can run:

```typescript
import Perplexity from "@perplexity-ai/perplexity_ai";

const response = await new Perplexity().responses.create({
  model: "openai/gpt-5.6-sol",
  input: "For AAPL, summarize management's Services commentary in the last available earnings call before 2026-09-25. Identify its fiscal period, source links, and open questions for the next report.",
  tools: [{ type: "finance_search" }],
  max_steps: 3,
});
if (response.status !== "completed") {
  throw new Error("Earnings research did not complete");
}
console.log(response.output_text);
```

Inspect any `finance_results` items and their source URLs in `response.output` before promoting commentary to a known fact. A generated summary is a starting point for examining the prior call, not a substitute for checking the underlying transcript. Coverage varies by company and period; if it cannot locate the call, leave that part of the brief open.

## 4. Find company announcements

The [Exa](https://exa.ai) [TypeScript SDK](https://exa.ai/docs/sdks/quickstart) can restrict web discovery to Apple's investor-relations and newsroom pages. This is a way to find a prior earnings release, webcast notice, or slides without assuming an earnings calendar's estimated date is confirmed:

```typescript
import Exa from "exa-js";

const pages = await new Exa().search(
  "Apple investor relations recent quarterly results and earnings webcast",
  {
    type: "auto",
    includeDomains: ["investor.apple.com", "apple.com/newsroom"],
    numResults: 5,
    contents: { highlights: true },
  },
);
for (const page of pages.results) {
  console.log(page.title, page.url, page.highlights);
}
```

[Exa](https://exa.ai) returns ranked pages and requested highlights, not a certified event calendar. Open the company's announcement and check the event date and fiscal period. If there is no announcement yet, say so; do not convert a search result for a *previous* earnings call into a date for the next one.

## Turn those searches into a brief someone can use

Give the agent a constrained final instruction:

> Prepare a one-page pre-earnings brief for Apple as of the date of this run. List three known facts from the latest filed 10-Q or 10-K, two relevant statements from the most recent available earnings call, and three questions for the next report. For every item include the fiscal period, source link, and whether it is a filed fact, a management statement, or an unanswered question. Do not predict results or fill missing transcripts with guesses.

One legitimate entry might read: **Known fact:** Apple's fiscal 2025 10-K reported $109.158 billion in Services net sales. **Next question:** How does the latest reported Services period compare with the corresponding prior period, and what explanation does management give for the change? That is useful preparation because it tells the reader exactly what to look for, while leaving the as-yet-unreported answer open. Re-run the filing and event searches immediately before sharing the brief; a later filing or confirmed call date can change the context.

*Method note: Library calls and coverage statements were checked against the linked SDK and API documentation on 25 September 2026. The Apple fiscal 2025 figure was checked in its filed 10-K. The [Valyu](https://valyu.ai), [SEC EDGAR Toolkit](https://github.com/stefanoamorelli/sec-edgar-toolkit), [Perplexity](https://www.perplexity.ai), and [Exa](https://exa.ai) examples were not run as a four-provider test; no specific ranking, transcript, or future announcement is claimed.*

## Definitions

- **Pre-earnings brief:** A short research note summarizing what a company has already reported, what management said previously, and which questions the next results could answer.

## Frequently asked questions

### Can the agent use a calendar API result as a confirmed earnings date?

Treat a calendar entry as a lead until the company's investor-relations announcement confirms the event. Dates can be estimated or rescheduled.

### Do I need all four APIs for every brief?

No. Search and filing libraries can cover discovery and official reports. Add prior-call research or investor-relations discovery only when it helps answer your question.

### How should an agent compare quarterly results before earnings?

Compare like fiscal periods, such as the latest reported quarter with the same quarter a year earlier. Check the units, currency and filing dates; do not compare a quarterly figure with an annual total or treat a reporting date as the date the result became public.

### What if the previous earnings-call transcript is unavailable?

Use the filed report and the company's dated results announcement for facts that those sources support. Mark management's prior remarks as unavailable and keep related questions open rather than inventing a quotation or treating a summary as a transcript.

## Sources

1. [Valyu Finance use case and Search API sources](https://docs.valyu.ai/use-cases/finance) — Valyu
2. [Valyu Search API reference](https://docs.valyu.ai/api-reference/endpoint/search.md) — Valyu
3. [Valyu TypeScript SDK Search guide](https://docs.valyu.ai/sdk/typescript-sdk/search) — Valyu
4. [EDGAR Application Programming Interfaces](https://www.sec.gov/search-filings/edgar-application-programming-interfaces) — U.S. Securities and Exchange Commission
5. [SEC EDGAR Toolkit TypeScript package and API reference](https://www.npmjs.com/package/sec-edgar-toolkit) — SEC EDGAR Toolkit
6. [Apple Inc. fiscal 2025 Form 10-K](https://www.sec.gov/Archives/edgar/data/320193/000032019325000079/aapl-20250927.htm) — U.S. Securities and Exchange Commission
7. [Perplexity Agent API Finance Search guide](https://docs.perplexity.ai/docs/agent-api/tools/finance-search) — Perplexity
8. [Exa TypeScript SDK quickstart](https://exa.ai/docs/sdks/quickstart) — Exa

## Distribution metadata

- Canonical Markdown SHA-256: 7f97540d468dd54c15e4cb02464912db7aca798bcfc6015395d20396176e4442
- Source bundle: https://www.searchforagents.com/api/v1/content/post_finance_earnings_research_agent/source-bundle

### Language alternates

- en: https://www.searchforagents.com/blog/how-to-use-an-agent-to-research-a-company-before-earnings
- x-default: https://www.searchforagents.com/blog/how-to-use-an-agent-to-research-a-company-before-earnings
