### Install and Use Brand.dev SDK - JavaScript/TypeScript Source: https://docs.brand.dev/quickstart Install the official brand.dev npm package and use it to retrieve brand data for a given domain. This example shows basic usage, a complete example with error handling, and TypeScript support. ```bash npm install brand.dev ``` ```typescript import BrandDev from "brand.dev"; const client = new BrandDev({ apiKey: process.env["BRAND_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); ``` ```typescript import BrandDev from "brand.dev"; const client = new BrandDev({ 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 BrandDev.APIError) { console.error("API Error:", error.status, error.message); } else { console.error("Error:", error); } throw error; } } // Usage getBrandData("meta.com").then(console.log); ``` ```typescript import BrandDev from "brand.dev"; const client = new BrandDev({ apiKey: process.env["BRAND_DEV_API_KEY"], }); const params: BrandDev.BrandRetrieveParams = { domain: "google.com" }; const brand: BrandDev.BrandRetrieveResponse = await client.brand.retrieve( params ); ``` -------------------------------- ### Install and Use Brand.dev SDK - Ruby Source: https://docs.brand.dev/quickstart Add the brand.dev gem to your Gemfile or install it directly, then use the client to retrieve brand data for a given domain. ```ruby gem 'brand.dev' ``` ```bash bundle install ``` ```bash gem install brand.dev ``` ```ruby require 'brand_dev' client = BrandDev::Client.new( api_key: ENV['BRAND_DEV_API_KEY'] ) # Retrieve brand data for a domain brand = client.brand.retrieve(domain: 'airbnb.com') puts brand.brand ``` -------------------------------- ### Install and Use Brand.dev SDK - Python Source: https://docs.brand.dev/quickstart Install the official brand.dev Python package and use it to retrieve brand data for a given domain. This example includes basic usage, a complete example with error handling, and specific API error handling. ```bash pip install brand.dev ``` ```python import brand_dev import os client = brand_dev.BrandDev( api_key=os.environ.get("BRAND_DEV_API_KEY"), ) # Retrieve brand data for a domain brand = client.brand.retrieve(domain="airbnb.com") print(brand.brand); ``` ```python import brand_dev import os def get_brand_data(domain): client = brand_dev.BrandDev( 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 brand_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") ``` ```python try { brand = client.brand.retrieve(domain="example.com") } catch (brand_dev.APIError as e) { if (e.status_code == 404) { print("Brand not found") } else if (e.status_code == 401) { print("Invalid API key") } else { print(f"API error: {e.status_code}") } } ``` -------------------------------- ### Retrieve Brand Data with Ruby Source: https://docs.brand.dev/quickstart This snippet shows how to initialize the BrandDev client, retrieve brand data for a given domain, and print key information such as company name, description, colors, and logos. It also includes error handling for API-specific errors and general exceptions. ```ruby require 'brand_dev' def get_brand_data(domain) client = BrandDev::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 BrandDev::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') ``` -------------------------------- ### Brand Retrieve API Source: https://docs.brand.dev/quickstart Retrieve brand data for a given domain using the Brand.dev API. ```APIDOC ## GET /v1/brand/retrieve ### Description Retrieves comprehensive brand information for a specified domain, including company details, colors, and logos. ### Method GET ### Endpoint `/v1/brand/retrieve` ### Parameters #### Query Parameters - **domain** (string) - Required - The domain for which to retrieve brand information. ### Request Example ```bash curl -X GET "https://api.brand.dev/v1/brand/retrieve?domain=airbnb.com" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ### Response #### Success Response (200) - **brand** (object) - Contains detailed brand information. - **title** (string) - The name of the brand. - **description** (string) - A brief description of the brand. - **colors** (object) - An object containing primary and secondary brand colors. - **logos** (object) - An object containing various logo formats and sizes. #### Response Example ```json { "brand": { "title": "Airbnb", "description": "A marketplace for lodging, primarily homestays for vacation rentals, and tourism activities.", "colors": { "primary": "#FF5A5F", "secondary": "#00A699" }, "logos": { "icon": "https://example.com/logos/airbnb_icon.png", "logo": "https://example.com/logos/airbnb_logo.png" } } } ``` #### Error Response (400, 401, 404, 500) - **error** (object) - Contains error details. - **status** (integer) - The HTTP status code of the error. - **message** (string) - A description of the error. #### Error Response Example ```json { "error": { "status": 404, "message": "Brand not found for the specified domain." } } ``` ``` -------------------------------- ### Handle Specific API Errors with Ruby Source: https://docs.brand.dev/quickstart This example demonstrates how to specifically handle different API error statuses when retrieving brand data using the BrandDev Ruby client. It checks for common errors like 'Brand not found' (404) and 'Invalid API key' (401), along with a general handler for other API errors. ```ruby begin brand = client.brand.retrieve(domain: 'example.com') rescue BrandDev::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 ``` -------------------------------- ### Extract Products API Request Example (JSON) Source: https://docs.brand.dev/changelog Example JSON request body for the AI Products Extraction API. It specifies the domain to analyze and the maximum number of products to extract. This endpoint is used for competitive analysis and market research. ```json { "domain": "example.com", "maxProducts": 5 } ``` -------------------------------- ### GET /brand/styleguide Source: https://docs.brand.dev/api-reference/screenshot-styleguide/extract-design-system-and-styleguide-from-website Extracts comprehensive design system and styleguide information from a brand's website, including colors, typography, spacing, shadows, and UI components. ```APIDOC ## GET /brand/styleguide ### Description Automatically extract comprehensive design system information from a brand's website including colors, typography, spacing, shadows, and UI components. ### Method GET ### Endpoint /brand/styleguide ### Parameters #### Query Parameters - **domain** (string) - Required - Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. - **timeoutMS** (integer) - Optional - Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). - **prioritize** (string) - Optional - Optional parameter to prioritize screenshot capture for styleguide extraction. If 'speed', optimizes for faster capture with basic quality. If 'quality', optimizes for higher quality with longer wait times. Defaults to 'quality' if not provided. (Enum: speed, quality) ### Response #### Success Response (200) - **status** (string) - Status of the response, e.g., 'ok' - **domain** (string) - The normalized domain that was processed - **styleguide** (object) - Comprehensive styleguide data extracted from the website - **mode** (string) - The primary color mode of the website design (Enum: light, dark) - **colors** (object) - Primary colors used on the website - **accent** (string) - Accent color of the website (hex format) - **background** (string) - Background color of the website (hex format) - **text** (string) - Text color of the website (hex format) - **typography** (object) - Typography styles used on the website - **headings** (object) - Heading styles - **h1** (object) - H1 heading styles - **fontFamily** (string) - **fontSize** (string) - **fontWeight** (number) - **lineHeight** (string) - **letterSpacing** (string) - **h2** (object) - H2 heading styles - **fontFamily** (string) - **fontSize** (string) - **fontWeight** (number) - **lineHeight** (string) - **letterSpacing** (string) #### Response Example ```json { "status": "ok", "domain": "example.com", "styleguide": { "mode": "light", "colors": { "accent": "#007bff", "background": "#ffffff", "text": "#212529" }, "typography": { "headings": { "h1": { "fontFamily": "Arial, sans-serif", "fontSize": "2.5rem", "fontWeight": 700, "lineHeight": "1.2", "letterSpacing": "-0.05em" }, "h2": { "fontFamily": "Georgia, serif", "fontSize": "2rem", "fontWeight": 600, "lineHeight": "1.3", "letterSpacing": "0" } } } } } ``` ``` -------------------------------- ### Test Brand.dev Action and Review Response Source: https://docs.brand.dev/zapier/setup This section details the process of testing a Brand.dev action and provides an example of the expected response structure. ```APIDOC ## Test Brand.dev Action ### Description This endpoint allows you to test a Brand.dev action and review the returned data structure to verify it matches your expectations. ### Method POST ### Endpoint `/websites/brand_dev/test` ### Parameters #### Query Parameters - **action_id** (string) - Required - The ID of the action to test. ### Request Body This endpoint does not require a request body. ### Response #### Success Response (200) - **status** (string) - The status of the action execution (e.g., "ok"). - **brand** (object) - An object containing detailed information about the brand. - **domain** (string) - The domain name of the brand. - **title** (string) - The title of the brand. - **description** (string) - A description of the brand. - **slogan** (string) - The slogan of the brand. - **colors** (array) - An array of color objects associated with the brand. - **hex** (string) - The hexadecimal color code. - **name** (string) - The name of the color. - **logos** (array) - An array of logo objects. - **url** (string) - The URL of the logo. - **mode** (string) - The display mode of the logo (e.g., "light", "has_opaque_background"). - **colors** (array) - An array of color objects for the logo. - **resolution** (object) - The resolution of the logo. - **width** (integer) - The width of the logo in pixels. - **height** (integer) - The height of the logo in pixels. - **aspect_ratio** (number) - The aspect ratio of the logo. - **type** (string) - The type of the logo (e.g., "icon", "logo"). - **backdrops** (array) - An array of backdrop objects. - **url** (string) - The URL of the backdrop. - **colors** (array) - An array of color objects for the backdrop. - **resolution** (object) - The resolution of the backdrop. - **width** (integer) - The width of the backdrop in pixels. - **height** (integer) - The height of the backdrop in pixels. - **aspect_ratio** (number) - The aspect ratio of the backdrop. - **address** (object) - The physical address of the brand. - **street** (string) - The street address. - **city** (string) - The city. - **country** (string) - The country. - **country_code** (string) - The country code. - **state_province** (string) - The state or province. - **state_code** (string) - The state or province code. - **postal_code** (string) - The postal code. - **socials** (array) - An array of social media links. - **type** (string) - The type of social media platform (e.g., "x", "facebook"). - **url** (string) - The URL of the social media profile. - **stock** (any) - Information about stock, can be null. - **phone** (string) - The phone number of the brand. - **is_nsfw** (boolean) - Indicates if the brand content is NSFW. - **industries** (object) - Information about the brand's industries. - **eic** (array) - An array of industry classifications. - **industry** (string) - The industry name. - **subindustry** (string) - The sub-industry name. - **links** (object) - Various links related to the brand. - **careers** (string, optional) - Link to careers page. - **terms** (string) - Link to terms of service. - **contact** (string) - Link to contact page. - **privacy** (string, optional) - Link to privacy policy. - **blog** (string) - Link to the brand's blog. - **pricing** (string) - Link to the pricing page. - **code** (integer) - The HTTP status code of the response (e.g., 200). #### Response Example ```json { "status": "ok", "brand": { "domain": "loom.com", "title": "Loom", "description": "Loom is a video messaging platform that enables users to record their screen, camera, or both, to communicate more effectively. Now part of Atlassian, Loom empowers remote teams to work asynchronously and make the impossible possible with video messaging, championing a remote-first work culture.", "slogan": "Empowering everyone to communicate more effectively, wherever they are", "colors": [ { "hex": "#040404", "name": "Armor Wash" }, { "hex": "#655ef3", "name": "Blue Hepatica" }, { "hex": "#acace2", "name": "Maximum Blue Purple" } ], "logos": [ { "url": "https://media.brand.dev/41361aac-0659-4a12-b4ab-e6b13276f6ad.jpg", "mode": "has_opaque_background", "colors": [ { "hex": "#655ef3", "name": "Blue Hepatica" }, { "hex": "#e3e3f3", "name": "Crystal Falls" } ], "resolution": { "width": 720, "height": 720, "aspect_ratio": 1 }, "type": "icon" }, { "url": "https://media.brand.dev/660ae867-d4a1-4c38-a815-6dbc1ceb33d5.svg", "mode": "light", "colors": [ { "hex": "#0c1414", "name": "Ruined Smores" } ], "resolution": { "width": 150, "height": 48, "aspect_ratio": 3.13 }, "type": "logo" }, { "url": "https://media.brand.dev/48bab401-ef69-40ee-9a4b-20290d93b558.svg", "mode": "light", "colors": [ { "hex": "#040404", "name": "Armor Wash" } ], "resolution": { "width": 84, "height": 25, "aspect_ratio": 3.36 }, "type": "logo" } ], "backdrops": [ { "url": "https://media.brand.dev/cbfda606-244b-4fde-9aaf-6ccc9d597a20.png", "colors": [ { "hex": "#3fa9d5", "name": "Summer Air" }, { "hex": "#2c2554", "name": "Ceremonial Purple" }, { "hex": "#d5c1d7", "name": "Tender Violet" } ], "resolution": { "width": 1500, "height": 500, "aspect_ratio": 3 } }, { "url": "https://media.brand.dev/94e5b368-6d5b-4021-ac00-c2970ed6b53a.png", "colors": [ { "hex": "#2b1c52", "name": "Pāua" }, { "hex": "#77596a", "name": "Exotic Orchid" }, { "hex": "#dddfed", "name": "Artemis Silver" } ], "resolution": { "width": 1200, "height": 627, "aspect_ratio": 1.91 } }, { "url": "https://media.brand.dev/59118ae5-3db4-4e6e-97f4-d914d53981c6.png", "colors": [ { "hex": "#1c6ad7", "name": "Flickr Blue" }, { "hex": "#edb638", "name": "Baklava" }, { "hex": "#53442e", "name": "Deep Bronze" } ], "resolution": { "width": 1128, "height": 191, "aspect_ratio": 5.91 } } ], "address": { "street": "140 2nd Street", "city": "San Francisco", "country": "United States", "country_code": "US", "state_province": "California", "state_code": "CA", "postal_code": "94105" }, "socials": [ { "type": "x", "url": "https://x.com/loom" }, { "type": "facebook", "url": "https://facebook.com/useloom" }, { "type": "linkedin", "url": "https://linkedin.com/company/useloom" }, { "type": "youtube", "url": "https://youtube.com/channel/ucnqj2rfvx8v0t377wcojyoa" } ], "stock": null, "phone": "3017125913", "is_nsfw": false, "industries": { "eic": [ { "industry": "Technology", "subindustry": "Software (B2B)" } ] }, "links": { "careers": null, "terms": "https://loom.com/legal", "contact": "https://loom.com/connect/enterprise", "privacy": null, "blog": "https://loom.com/newsroom", "pricing": "https://loom.com/pricing" } }, "code": 200 } ``` ``` -------------------------------- ### GET /retrieve Source: https://docs.brand.dev/changelog Performance improvements have been made to the `/retrieve` endpoint, reducing the p50 latency for cold hits to 7 seconds. ```APIDOC ## GET /retrieve ### Description Significant performance improvement: the p50 latency for cold hits on the `/retrieve` endpoint is now down to 7 seconds, thanks to continued infrastructure optimizations and caching improvements. ### Method GET ### Endpoint `/retrieve` ### Parameters (No specific parameters mentioned for this performance update, assume standard retrieval parameters apply) ### Response #### Success Response (200) Returns brand data with improved retrieval latency. #### Response Example (Standard response for `/retrieve` endpoint, but with faster response times) ``` -------------------------------- ### Retrieve Endpoint Links Example (JSON) Source: https://docs.brand.dev/changelog This JSON snippet demonstrates the structure of the new 'links' object available in the retrieve endpoint response. It includes URLs for careers, blog, terms, privacy, contact, and pricing pages. ```json { "links": { "careers": "https://company.com/careers", "blog": "https://company.com/blog", "terms": "https://company.com/terms", "privacy": "https://company.com/privacy", "contact": "https://company.com/contact", "pricing": "https://company.com/pricing" } } ``` -------------------------------- ### Example Typography Data from Styleguide Endpoint Source: https://docs.brand.dev/changelog This JSON snippet demonstrates the comprehensive typography data available through the new styleguide endpoint. It includes detailed specifications for both headings (H1) and paragraph text, covering font family, size, weight, line height, and letter spacing. This richer data replaces the basic font information previously available via the retrieve endpoint. ```json { "typography": { "headings": { "h1": { "fontFamily": "Inter, sans-serif", "fontSize": "2.5rem", "fontWeight": 700, "lineHeight": "1.2", "letterSpacing": "0.025em" } }, "p": { "fontFamily": "Inter, sans-serif", "fontSize": "1rem", "fontWeight": 400, "lineHeight": "1.6", "letterSpacing": "0.01em" } } } ``` -------------------------------- ### Styleguide API Enhancements Source: https://docs.brand.dev/changelog The Styleguide API now includes a `prioritize` parameter to control the trade-off between capture speed and output quality for design system extraction. ```APIDOC ## GET /styleguide ### Description Extracts design system information from a website. ### Method GET ### Endpoint /styleguide ### Parameters #### Query Parameters - **url** (string) - Required - The URL of the website to analyze. - **prioritize** (string) - Optional - Determines the capture strategy. Options: `speed` (faster extraction, basic quality) or `quality` (higher quality, longer wait times). Defaults to `speed`. ### Request Example ```json { "url": "https://example.com", "prioritize": "quality" } ``` ### Response #### Success Response (200) - **design_system_data** (object) - Contains the extracted design system information. #### Response Example ```json { "design_system_data": { "colors": [...], "fonts": [...], "spacing": "..." } } ``` ``` -------------------------------- ### GET /websites/brand_dev Source: https://docs.brand.dev/api-reference/retrieve-brand/retrieve-brand-data-by-email-address Retrieves detailed information about a specific brand. This endpoint is secured and requires authentication. ```APIDOC ## GET /websites/brand_dev ### Description Retrieves detailed information about a specific brand. This endpoint is secured and requires authentication. ### Method GET ### Endpoint /websites/brand_dev ### Parameters #### Query Parameters (No query parameters defined) #### Path Parameters (No path parameters defined) #### Request Body (Not applicable for GET requests) ### Request Example (No request body example provided) ### Response #### Success Response (200) - **status** (string) - Status of the response, e.g., 'ok' - **brand** (object) - Detailed brand information - **domain** (string) - The domain name of the brand - **title** (string) - The title or name of the brand - **description** (string) - A brief description of the brand - **slogan** (string) - The brand's slogan - **colors** (array) - An array of brand colors - **hex** (string) - Color in hexadecimal format - **name** (string) - Name of the color - **logos** (array) - An array of logos associated with the brand - **url** (string) - CDN hosted url of the logo (ready for display) - **mode** (string) - Enum: 'light', 'dark', 'has_opaque_background'. Indicates when this logo is best used. - **colors** (array) - Array of colors in the logo - **hex** (string) - Color in hexadecimal format - **name** (string) - Name of the color - **resolution** (object) - Resolution of the logo image - **width** (integer) - Width of the image in pixels - **height** (integer) - Height of the image in pixels - **aspect_ratio** (number) - Aspect ratio of the image (width/height) - **type** (string) - Enum: 'icon', 'logo'. Type of the logo based on resolution. - **backdrops** (array) - An array of backdrop images for the brand - **url** (string) - URL of the backdrop image - **colors** (array) - Array of colors in the backdrop image - **hex** (string) - Color in hexadecimal format - **name** (string) - Name of the color - **resolution** (object) - Resolution of the backdrop image - **width** (integer) - Width of the image in pixels - **height** (integer) - Height of the image in pixels - **aspect_ratio** (number) - Aspect ratio of the image (width/height) - **socials** (array) - An array of social media links for the brand - **(Properties for social objects are not fully defined in the provided schema)** #### Error Response (e.g., 400, 401, 404, 500) - **$ref**: '#/components/schemas/ErrorResponse' #### Response Example ```json { "status": "ok", "brand": { "domain": "example.com", "title": "Example Brand", "description": "This is an example brand description.", "slogan": "Your slogan here.", "colors": [ { "hex": "#FFFFFF", "name": "White" } ], "logos": [ { "url": "https://cdn.example.com/logo.png", "mode": "light", "colors": [ { "hex": "#000000", "name": "Black" } ], "resolution": { "width": 200, "height": 50, "aspect_ratio": 4 }, "type": "logo" } ], "backdrops": [ { "url": "https://cdn.example.com/backdrop.jpg", "colors": [ { "hex": "#CCCCCC", "name": "Gray" } ], "resolution": { "width": 1920, "height": 1080, "aspect_ratio": 1.7777777777777777 } } ], "socials": [ { "platform": "twitter", "url": "https://twitter.com/example" } ] } } ``` ``` -------------------------------- ### GET /websites/brand_dev Source: https://docs.brand.dev/api-reference/retrieve-brand/identify-brand-from-transaction-data Retrieves brand assets including logos, backdrops, and social media links for the specified brand. ```APIDOC ## GET /websites/brand_dev ### Description Retrieves detailed information about a brand, including its logos, backdrop images, and social media links. ### Method GET ### Endpoint /websites/brand_dev ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **logos** (array) - An array of logo objects associated with the brand. - **url** (string) - CDN hosted URL of the logo. - **mode** (string) - Indicates when this logo is best used ('light', 'dark', 'has_opaque_background'). - **colors** (array) - Array of colors present in the logo. - **hex** (string) - Color in hexadecimal format. - **name** (string) - Name of the color. - **resolution** (object) - Resolution details of the logo image. - **width** (integer) - Width of the image in pixels. - **height** (integer) - Height of the image in pixels. - **aspect_ratio** (number) - Aspect ratio of the image (width/height). - **type** (string) - Type of the logo ('icon', 'logo'). - **backdrops** (array) - An array of backdrop image objects for the brand. - **url** (string) - URL of the backdrop image. - **colors** (array) - Array of colors present in the backdrop image. - **hex** (string) - Color in hexadecimal format. - **name** (string) - Name of the color. - **resolution** (object) - Resolution details of the backdrop image. - **width** (integer) - Width of the image in pixels. - **height** (integer) - Height of the image in pixels. - **aspect_ratio** (number) - Aspect ratio of the image (width/height). - **socials** (array) - An array of social media link objects for the brand. - **type** (string) - Type of the social media platform. #### Response Example ```json { "logos": [ { "url": "https://example.com/logo.png", "mode": "light", "colors": [ { "hex": "#FFFFFF", "name": "white" } ], "resolution": { "width": 200, "height": 50, "aspect_ratio": 4 }, "type": "logo" } ], "backdrops": [ { "url": "https://example.com/backdrop.jpg", "colors": [ { "hex": "#000000", "name": "black" } ], "resolution": { "width": 1920, "height": 1080, "aspect_ratio": 1.777 } } ], "socials": [ { "type": "twitter", "url": "https://twitter.com/brand" } ] } ``` ``` -------------------------------- ### Create Brand Summary (Python) Source: https://docs.brand.dev/zapier/recipes Generates a comprehensive summary string and extracts key metrics from brand data. It parses JSON input and handles missing fields gracefully. Requires the 'json' library. ```python import json input_data = json.loads(input_data.get('inputData', '{}')) brand = input_data.get('brand', {}) # Create a comprehensive brand summary summary = f""" Company: {brand.get('title', 'N/A')} Domain: {brand.get('domain', 'N/A')} Description: {brand.get('description', 'N/A')} Slogan: {brand.get('slogan', 'N/A')} Email: {brand.get('email', 'N/A')} Phone: {brand.get('phone', 'N/A')} Colors: {len(brand.get('colors', []))} colors found Logos: {len(brand.get('logos', []))} logos found Social Media: {len(brand.get('socials', []))} platforms """ # Add industry info industries = brand.get('industries', {}).get('eic', []) if industries: summary += f"Primary Industry: {industries[0].get('industry', 'N/A')}\n" # Add stock info stock = brand.get('stock', {}) if stock.get('ticker'): summary += f"Stock: {stock.get('ticker', '')} on {stock.get('exchange', '')}\n" output = { 'brand_summary': summary.strip(), 'company_name': brand.get('title', ''), 'domain': brand.get('domain', ''), 'color_count': len(brand.get('colors', [])), 'logo_count': len(brand.get('logos', [])), 'social_count': len(brand.get('socials', [])) } ``` -------------------------------- ### GET /brand/screenshot Source: https://docs.brand.dev/api-reference/screenshot-styleguide/take-screenshot-of-website Capture a screenshot of a website. Supports both viewport and full-page screenshots, and can screenshot specific page types. ```APIDOC ## GET /brand/screenshot ### Description Capture a screenshot of a website. Supports both viewport (standard browser view) and full-page screenshots. Can also screenshot specific page types (login, pricing, etc.) by using heuristics to find the appropriate URL. Returns a URL to the uploaded screenshot image hosted on our CDN. ### Method GET ### Endpoint /brand/screenshot ### Parameters #### Query Parameters - **domain** (string) - Required - Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. - **fullScreenshot** (string) - Optional - Enum: ['true', 'false'] - Optional parameter to determine screenshot type. If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view). - **page** (string) - Optional - Enum: ['login', 'signup', 'blog', 'careers', 'pricing', 'terms', 'privacy', 'contact'] - Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type. If not provided, screenshots the main domain landing page. - **prioritize** (string) - Optional - Enum: ['speed', 'quality'] - Optional parameter to prioritize screenshot capture. If 'speed', optimizes for faster capture with basic quality. If 'quality', optimizes for higher quality with longer wait times. Defaults to 'quality' if not provided. ### Response #### Success Response (200) - **status** (string) - Status of the response, e.g., 'ok' - **domain** (string) - The normalized domain that was processed - **screenshot** (string) - Public URL of the uploaded screenshot image - **screenshotType** (string) - Enum: ['viewport', 'fullPage'] - Type of screenshot that was captured - **code** (integer) - HTTP status code #### Response Example ```json { "status": "ok", "domain": "example.com", "screenshot": "https://cdn.brand.dev/screenshots/example.com.png", "screenshotType": "viewport", "code": 200 } ``` #### Error Response (400) - **message** (string) - Error message - **error_code** (string) - Enum: ['INTERNAL_ERROR', 'VALID', 'NOT_FOUND', 'FORBIDDEN', 'USAGE_EXCEEDED', 'RATE_LIMITED', 'UNAUTHORIZED', 'DISABLED', 'INSUFFICIENT_PERMISSIONS', 'TIMEOUT_EXCEEDS_MAXIMUM', 'WEBSITE_ACCESS_ERROR', 'INPUT_VALIDATION_ERROR'] - Error code indicating the type of error #### Error Response Example ```json { "message": "Invalid domain provided.", "error_code": "INPUT_VALIDATION_ERROR" } ``` #### Error Response (401) - **error_code** (string) - Enum: ['INTERNAL_ERROR', 'VALID', 'NOT_FOUND', 'FORBIDDEN', 'USAGE_EXCEEDED'] #### Error Response Example ```json { "error_code": "UNAUTHORIZED" } ``` ``` -------------------------------- ### GET /brand/retrieve-by-name Source: https://docs.brand.dev/api-reference/retrieve-brand/retrieve-brand-data-by-company-name Retrieve brand data by company name. This endpoint searches for the company by name and returns its brand data. ```APIDOC ## GET /brand/retrieve-by-name ### Description Retrieve brand data by company name. This endpoint searches for the company by name and returns its brand data. ### Method GET ### Endpoint /brand/retrieve-by-name ### Parameters #### Query Parameters - **name** (string) - Required - Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft Corporation'). Must be 3-30 characters. - **force_language** (string) - Optional - Optional parameter to force the language of the retrieved brand data. Allowed values: albanian, arabic, azeri, bengali, bulgarian, cebuano, croatian, czech, danish, dutch, english, estonian, farsi, finnish, french, german, hausa, hawaiian, hindi, hungarian, icelandic, indonesian, italian, kazakh, kyrgyz, latin, latvian, lithuanian, macedonian, mongolian, nepali, norwegian, pashto, pidgin, polish, portuguese, romanian, russian, serbian, slovak, slovene, somali, spanish, swahili, swedish, tagalog, turkish, ukrainian, urdu, uzbek, vietnamese, welsh. - **maxSpeed** (boolean) - Optional - Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data. - **timeoutMS** (integer) - Optional - Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes). ### Request Example ```json { "example": "Not applicable for GET requests with query parameters" } ``` ### Response #### Success Response (200) - **status** (string) - Status of the response, e.g., 'ok' - **brand** (object) - Detailed brand information - **domain** (string) - The domain name of the brand - **title** (string) - The title or name of the brand - **description** (string) - A brief description of the brand - **slogan** (string) - The brand's slogan - **colors** (array) - An array of brand colors - **hex** (string) - Hexadecimal color code #### Error Response (400, 408, 500) - **status** (string) - Status of the error response, e.g., 'error' - **message** (string) - Description of the error #### Response Example (200) ```json { "status": "ok", "brand": { "domain": "apple.com", "title": "Apple", "description": "Apple Inc. is an American multinational technology company headquartered in Cupertino, California.", "slogan": "Think Different", "colors": [ { "hex": "#000000" } ] } } ``` #### Response Example (400) ```json { "status": "error", "message": "Company name not found or invalid." } ``` #### Response Example (408) ```json { "status": "error", "message": "Request timed out." } ``` #### Response Example (500) ```json { "status": "error", "message": "An internal server error occurred." } ``` ``` -------------------------------- ### GitHub Login/Signup Support Source: https://docs.brand.dev/changelog Allows users to sign up and log in to their accounts using GitHub authentication. ```APIDOC ## GitHub Login/Signup Support ### Description Allows users to sign up and log in to their account using GitHub. ### Method POST ### Endpoint /auth/github ### Parameters #### Request Body - **code** (string) - Required - The authorization code received from GitHub. ### Request Example ```json { "code": "YOUR_GITHUB_AUTHORIZATION_CODE" } ``` ### Response #### Success Response (200) - **token** (string) - The authentication token. - **user** (object) - User details. - **id** (string) - User ID. - **email** (string) - User email. - **name** (string) - User name. #### Response Example ```json { "token": "YOUR_AUTH_TOKEN", "user": { "id": "user_123", "email": "user@example.com", "name": "John Doe" } } ``` ``` -------------------------------- ### GET /websites/brand_dev Source: https://docs.brand.dev/api-reference/retrieve-brand/retrieve-brand-data-by-isin Retrieves comprehensive brand information, including colors, logos, backdrops, social media links, and address. ```APIDOC ## GET /websites/brand_dev ### Description Retrieves comprehensive brand information, including colors, logos, backdrops, social media links, and address. ### Method GET ### Endpoint /websites/brand_dev ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **colors** (array) - An array of brand colors. Each color object has `hex` (string) and `name` (string). - **logos** (array) - An array of logos associated with the brand. Each logo object includes `url` (string), `mode` (enum: 'light', 'dark', 'has_opaque_background'), `colors` (array of color objects), `resolution` (object with `width`, `height`, `aspect_ratio`), and `type` (enum: 'icon', 'logo'). - **backdrops** (array) - An array of backdrop images for the brand. Each backdrop object includes `url` (string), `colors` (array of color objects), and `resolution` (object with `width`, `height`, `aspect_ratio`). - **socials** (array) - An array of social media links for the brand. Each social object has `type` (string) and `url` (string). - **address** (object) - Physical address of the brand, containing `street`, `city`, `country`, `country_code`, and `state_province` (all strings). #### Response Example ```json { "colors": [ { "hex": "#FFFFFF", "name": "White" } ], "logos": [ { "url": "https://example.com/logo.png", "mode": "light", "colors": [ { "hex": "#000000", "name": "Black" } ], "resolution": { "width": 500, "height": 200, "aspect_ratio": 2.5 }, "type": "logo" } ], "backdrops": [ { "url": "https://example.com/backdrop.jpg", "colors": [ { "hex": "#CCCCCC", "name": "Gray" } ], "resolution": { "width": 1920, "height": 1080, "aspect_ratio": 1.777 } } ], "socials": [ { "type": "twitter", "url": "https://twitter.com/brand" } ], "address": { "street": "123 Brand St", "city": "Brandville", "country": "Brandland", "country_code": "BL", "state_province": "BS" } } ``` ```