> ## Documentation Index
> Fetch the complete documentation index at: https://docs.context.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Setting up Context.dev for a user? Follow https://docs.context.dev/agent-quickstart.md. MCP clients sign in with OAuth and need no API key; application code reads CONTEXT_DEV_API_KEY.

# News

> Find articles about a company and page through the results.

News Search finds current and historical articles about one company. Results include story identifiers, source metadata, and company relevance.

## Find company news

Search by the company’s domain. See the [Quickstart](/quickstart) for authentication and SDK setup.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import ContextDev from "context.dev";

  const client = new ContextDev({ apiKey: process.env.CONTEXT_DEV_API_KEY });
  const news = await client.news.search({
    searchBy: { type: "entity", entity: { type: "domain", domain: "stripe.com" } },
    limit: 10,
  });

  console.log(news.data);
  ```

  ```python Python theme={null}
  import os
  from context.dev import ContextDev

  client = ContextDev(api_key=os.environ["CONTEXT_DEV_API_KEY"])
  news = client.news.search(
      search_by={"type": "entity", "entity": {"type": "domain", "domain": "stripe.com"}},
      limit=10,
  )

  print(news.data)
  ```

  ```ruby Ruby theme={null}
  require "cgi/core"
  require "context_dev"

  client = ContextDev::Client.new(api_key: ENV.fetch("CONTEXT_DEV_API_KEY"))
  news = client.news.search(
    search_by: {type: "entity", entity: {type: "domain", domain: "stripe.com"}},
    limit: 10,
  )

  pp news.data
  ```

  ```go Go theme={null}
  package main

  import (
      "context"
      "fmt"
      "os"

      contextdev "github.com/context-dot-dev/context-go-sdk/v2"
      "github.com/context-dot-dev/context-go-sdk/v2/option"
  )

  func main() {
      client := contextdev.NewClient(option.WithAPIKey(os.Getenv("CONTEXT_DEV_API_KEY")))
      news, err := client.News.Search(context.Background(), contextdev.NewsSearchParams{
          SearchBy: contextdev.NewsSearchParamsSearchBy{
              Type: "entity",
              Entity: contextdev.NewsSearchParamsSearchByEntityUnion{
                  OfDomain: &contextdev.NewsSearchParamsSearchByEntityDomain{Domain: "stripe.com"},
              },
          },
          Limit: contextdev.Int(10),
      })
      if err != nil {
          panic(err)
      }

      fmt.Printf("%+v\n", news.Data)
  }
  ```

  ```php PHP theme={null}
  <?php

  require __DIR__.'/vendor/autoload.php';

  use ContextDev\Client;

  $client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY'));
  $news = $client->news->search(
      searchBy: ['type' => 'entity', 'entity' => ['type' => 'domain', 'domain' => 'stripe.com']],
      limit: 10,
  );

  print_r($news->data);
  ```

  ```bash cURL theme={null}
  curl https://api.context.dev/v1/news/search \
    -H "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "searchBy": {"type": "entity", "entity": {"type": "domain", "domain": "stripe.com"}},
      "limit": 10
    }'
  ```
</CodeGroup>

## Identify the company

| `entity.type` | Fields                              |
| ------------- | ----------------------------------- |
| `name`        | `name`.                             |
| `domain`      | `domain`.                           |
| `ticker`      | `ticker`, with optional `exchange`. |
| `isin`        | `isin`.                             |

## Read the articles

Articles are in `data`. `has_more` and `next_cursor` indicate another page; `meta` describes the search. Results default to newest first and ten articles per page.

Use [filters and sorting](/news/filter-and-sort) to select a source category or date window, and [pagination](/news/paginate) for longer histories. An unknown company can return 404; invalid filters return 400. The [News reference](/api-reference/news/search) lists the response fields.
