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

# Quickstart

> Start building with Context.dev in 2 easy steps

<Steps>
  <Step title="Get Your API Key">
    Sign up for an account at [context.dev](https://context.dev/signup)
    then copy and securely store your API key, you'll need it for all API
    requests.
  </Step>

  <Step title="Install SDK & Usage">
    <AccordionGroup>
      <Accordion icon="js" title="JavaScript/TypeScript">
        ### Installation

        Install the official context.dev npm package:

        ```bash theme={null}
        npm install context.dev
        ```

        ### Basic Usage

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

        const client = new ContextDev({
          apiKey: process.env["CONTEXT_DEV_API_KEY"], // Set your API key
        });

        // Retrieve brand data for a domain
        const brand = await client.brand.retrieve({ domain: "airbnb.com" });
        console.log(brand.brand);
        ```

        ### Complete Example

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

        const client = new ContextDev({
          apiKey: "your-api-key-here",
        });

        async function getBrandData(domain: string) {
          try {
            const response = await client.brand.retrieve({ domain });

            console.log("Company:", response.brand.title);
            console.log("Description:", response.brand.description);
            console.log("Colors:", response.brand.colors);
            console.log("Logos:", response.brand.logos);

            return response.brand;
          } catch (error) {
            if (error instanceof ContextDev.APIError) {
              console.error("API Error:", error.status, error.message);
            } else {
              console.error("Error:", error);
            }
            throw error;
          }
        }

        // Usage
        getBrandData("meta.com").then(console.log);
        ```

        ### TypeScript Support

        The package includes full TypeScript definitions:

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

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

        const params: ContextDev.BrandRetrieveParams = { domain: "google.com" };
        const brand: ContextDev.BrandRetrieveResponse = await client.brand.retrieve(
          params
        );
        ```
      </Accordion>

      <Accordion icon="python" title="Python">
        ### Installation

        Install the official context.dev Python package:

        ```bash theme={null}
        pip install context.dev
        ```

        ### Basic Usage

        ```python theme={null}
        import context_dev
        import os

        client = context_dev.ContextDev(
            api_key=os.environ.get("CONTEXT_DEV_API_KEY"),
        )

        # Retrieve brand data for a domain
        brand = client.brand.retrieve(domain="airbnb.com")
        print(brand.brand)
        ```

        ### Complete Example

        ```python theme={null}
        import context_dev
        import os

        def get_brand_data(domain):
            client = context_dev.ContextDev(
                api_key="your-api-key-here",
            )

            try:
                response = client.brand.retrieve(domain=domain)
                brand = response.brand

                print(f"Company: {brand.title}")
                print(f"Description: {brand.description}")
                print(f"Colors: {brand.colors}")
                print(f"Logos: {brand.logos}")

                return brand
            except context_dev.APIError as e:
                print(f"API Error: {e.status_code} - {e.message}")
                raise
            except Exception as e:
                print(f"Error: {e}")
                raise

        # Usage
        brand_data = get_brand_data("meta.com")
        ```

        ### Error Handling

        ```python theme={null}
        try:
            brand = client.brand.retrieve(domain="example.com")
        except context_dev.APIError as e:
            if e.status_code == 404:
                print("Brand not found")
            elif e.status_code == 401:
                print("Invalid API key")
            else:
                print(f"API error: {e.status_code}")
        ```
      </Accordion>

      <Accordion icon="gem" title="Ruby">
        ### Installation

        Add the context.dev gem to your Gemfile:

        ```ruby theme={null}
        gem 'context.dev'
        ```

        Then run:

        ```bash theme={null}
        bundle install
        ```

        Or install directly:

        ```bash theme={null}
        gem install context.dev
        ```

        ### Basic Usage

        ```ruby theme={null}
        require 'context_dev'

        client = ContextDev::Client.new(
          api_key: ENV['CONTEXT_DEV_API_KEY']
        )

        # Retrieve brand data for a domain
        brand = client.brand.retrieve(domain: 'airbnb.com')
        puts brand.brand
        ```

        ### Complete Example

        ```ruby theme={null}
        require 'context_dev'

        def get_brand_data(domain)
          client = ContextDev::Client.new(
            api_key: 'your-api-key-here'
          )

          begin
            response = client.brand.retrieve(domain: domain)
            brand = response.brand

            puts "Company: #{brand.title}"
            puts "Description: #{brand.description}"
            puts "Colors: #{brand.colors}"
            puts "Logos: #{brand.logos}"

            brand
          rescue ContextDev::APIError => e
            puts "API Error: #{e.status} - #{e.message}"
            raise
          rescue => e
            puts "Error: #{e.message}"
            raise
          end
        end

        # Usage
        brand_data = get_brand_data('meta.com')
        ```

        ```ruby theme={null}
        begin
          brand = client.brand.retrieve(domain: 'example.com')
        rescue ContextDev::APIError => e
          case e.status
          when 404
            puts "Brand not found"
          when 401
            puts "Invalid API key"
          else
            puts "API error: #{e.status}"
          end
        end
        ```
      </Accordion>
    </AccordionGroup>
  </Step>
</Steps>

## Endpoints & Response Structure

To view all endpoints and their respective responses, please visit the API documentation below.

<Card title="API Reference" icon="book" href="/api-reference">
  Explore all available endpoints and parameters
</Card>

<Tip>
  Need help implementing a specific use case? [Contact our
  team](mailto:hello@context.dev) for personalized guidance.
</Tip>
