> ## 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.

# Retrieve brands by domain

> Get logos, colors, and company details from a domain, with controls for speed and freshness.

Use a domain lookup when you already know the company's website. It is the least ambiguous Brand lookup and returns the shared Brand profile.

## Send a domain

```bash theme={null}
export CONTEXT_DEV_API_KEY="ctxt_secret_..."
```

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.context.dev/v1/brand/retrieve \
    --request POST \
    --header "Authorization: Bearer $CONTEXT_DEV_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "type": "by_domain",
      "domain": "stripe.com"
    }'
  ```

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

  const client = new ContextDev({
    apiKey: process.env.CONTEXT_DEV_API_KEY,
  });

  const response = await client.brand.retrieve({
    type: "by_domain",
    domain: "stripe.com",
  });

  console.log(response.brand?.domain, response.brand?.title);
  ```

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

  client = ContextDev(api_key=os.environ["CONTEXT_DEV_API_KEY"])

  response = client.brand.retrieve(
      type="by_domain",
      domain="stripe.com",
  )

  if response.brand:
      print(response.brand.domain, response.brand.title)
  ```

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

  client = ContextDev::Client.new(
    api_key: ENV.fetch("CONTEXT_DEV_API_KEY")
  )

  response = client.brand.retrieve(
    body: {
      type: :by_domain,
      domain: "stripe.com",
    }
  )

  puts response.brand&.title
  ```

  ```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")),
      )

      response, err := client.Brand.Get(
          context.Background(),
          contextdev.BrandGetParams{
              OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
                  Domain: "stripe.com",
              },
          },
      )
      if err != nil {
          panic(err)
      }

      fmt.Println(response.Brand.Title)
  }
  ```

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

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

  use ContextDev\Client;

  $client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY'));

  // Use the SDK's low-level request method until the Brand helper is fixed.
  $raw = $client->request(
      method: 'post',
      path: 'brand/retrieve',
      body: [
          'type' => 'by_domain',
          'domain' => 'stripe.com',
      ],
  );

  $response = json_decode((string) $raw->getBody(), true, flags: JSON_THROW_ON_ERROR);
  echo $response['brand']['title'] ?? 'No brand found', PHP_EOL;
  ```
</CodeGroup>

<Note>
  The PHP tab uses the SDK's low-level request method because the `2.14.0` Brand helper requires conflicting lookup fields. See the [PHP guide](/sdks/php) for details.
</Note>

The endpoint costs 10 credits. Use the returned `brand.domain` as the normalized company domain in your own record.

## Tune the lookup

| Need                     | Option           | Tradeoff                                                                      |
| ------------------------ | ---------------- | ----------------------------------------------------------------------------- |
| Lower latency            | `maxSpeed=true`  | Skips time-consuming work and can return fewer fields.                        |
| A specific language      | `force_language` | Requests a supported output language.                                         |
| A different cache window | `maxAgeMs`       | Defaults to three months; values below one day or above one year are clamped. |
| A bounded request        | `timeoutMS`      | Aborts with `408` after your chosen budget, up to five minutes.               |

```json theme={null}
{
  "type": "by_domain",
  "domain": "stripe.com",
  "maxSpeed": true,
  "timeoutMS": 60000
}
```

## Handle cold domains

A domain that is not already cached can require fresh retrieval and take longer than a cache hit. Avoid a very short timeout on an interactive path:

* Set a realistic `timeoutMS` and show a loading state.
* Use [prefetching](/optimization/prefetching) when you learn the domain before you need the profile.
* Cache the successful response in your own application according to your product's freshness needs.

Brand fields are discovered independently. A `200` does not mean every nested field is populated; provide fallbacks for assets, contact data, stock data, employee counts, and links.

## Other lookup options

<CardGroup cols={2}>
  <Card title="Retrieve brands by name" icon="building" href="/guides/retrieve-brand-by-name">
    Find a company profile when you do not know its website.
  </Card>

  <Card title="Retrieve brands by email" icon="envelope" href="/guides/retrieve-brand-by-email">
    Start enrichment with a work email during onboarding.
  </Card>

  <Card title="Extract brands from URLs" icon="link" href="/guides/retrieve-brand-by-direct-url">
    Read brand fields from one specific webpage.
  </Card>

  <Card title="Retrieve brand data" icon="palette" href="/guides/get-brand-data">
    Understand the shared brand response model.
  </Card>

  <Card title="Brand API reference" icon="code" href="/api-reference/brand-intelligence/brand">
    Review the complete request and response contract.
  </Card>
</CardGroup>
