Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ jobs:

- name: Run build
run: 'npm run build'

# Live conformance runs only where an API key is available (skipped on forks).
- name: Live conformance
if: ${{ env.CONTEXT_DEV_API_KEY != '' }}
env:
CONTEXT_DEV_API_KEY: ${{ secrets.CONTEXT_DEV_API_KEY }}
run: 'node tests/live/run-live.mjs --delay 150'
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### 3.0.0

- Migrate to the api.context.dev/v1 API with full SDK v1.41 parity across every resource
- Add the **Monitors** resource — 11 operations (create / get / update / delete / run, list monitors, list account changes & runs, list monitor changes & runs, get change)
- Sync all web / brand / AI / industry / utility request params, enums and numeric bounds to the SDK — including nested pdf/viewport/enrichment/markdownOptions, discriminated monitor targets, webhook secret, AI specific_pages, and correct per-operation scoping

#### [1.3.0](https://github.com/brand-dot-dev/n8n-integration/compare/1.2.0...1.3.0)

- Update repository URL in package.json [`72cc1af`](https://github.com/brand-dot-dev/n8n-integration/commit/72cc1afb0becc8a5af231d848cd4f53ff08fd65d)
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Context.dev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
233 changes: 133 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,125 +1,158 @@
# n8n-nodes-branddev
# n8n-nodes-context-dev

This is an n8n community node that lets you interact with the [Brand.dev API](https://brand.dev) in your n8n workflows.
n8n community node for the [Context.dev](https://context.dev) API — brand intelligence, web scraping, AI extraction, monitoring, and web databases.

Brand.dev provides comprehensive brand data including logos, colors, fonts, screenshots, styleguides, and company information for millions of brands worldwide.

[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.

[Installation](#installation) | [Operations](#operations) | [Credentials](#credentials) | [Compatibility](#compatibility) | [Resources](#resources)
**53 operations** across 9 resources, covering the full Context.dev API surface.

## Installation

Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
In n8n, go to **Settings → Community nodes → Install** and enter:

For the n8n desktop app, go to **Settings** > **Community Nodes** and search for `n8n-nodes-branddev`.
```
n8n-nodes-context-dev
```

## Operations
Or install it manually:

This node supports the following resources and operations:

### Brand
- **Retrieve by Domain** - Get brand information by domain name
- Returns logos, colors, fonts, company info, social media, and more
- Supports 50+ languages via `force_language` parameter
- Optional speed optimization for faster responses
- Configurable timeout (1-300,000ms)

- **Retrieve by Company Name** - Search for a company by name and retrieve brand data
- Fuzzy search for company names (3-30 characters)
- Returns comprehensive brand data

- **Retrieve by Email** - Extract domain from email and retrieve brand data
- Excludes free email providers (gmail.com, yahoo.com, etc.)
- Blocks disposable email addresses

- **Retrieve by Stock Ticker** - Look up company by stock ticker symbol
- Supports 30+ global stock exchanges (NASDAQ, NYSE, LSE, JPX, HKSE, etc.)
- Configurable exchange via `ticker_exchange` parameter

- **Retrieve by ISIN** - Look up company by International Securities Identification Number
- Global securities identification
- Returns full brand data

### Industry Classification (NAICS)
- **Classify Brand** - Get NAICS (North American Industry Classification System) codes for any brand
- Accepts domain or company name as input
- Returns 1-10 NAICS codes with confidence scores
- Configurable min/max results
- Supports detailed 6-digit NAICS codes

### Screenshot / Styleguide
- **Take Screenshot** - Capture a viewport or full-page screenshot of any website
- Viewport or full-page screenshots
- Specific page types (login, pricing, careers, contact, blog, etc.)
- Quality vs speed optimization
- Returns high-quality screenshot URL

- **Extract Styleguide** - Extract comprehensive design system including colors, typography, spacing, shadows, and components
- Color palettes with usage statistics
- Typography scales and font information
- Spacing and sizing systems
- Box shadows and border radius values
- Component patterns and styles

- **Extract Fonts** - Get detailed font information including families, usage statistics, and fallbacks
- Font family detection
- Usage statistics (element count, word count)
- Fallback chains
- Font weights and styles
```sh
npm install n8n-nodes-context-dev
```

## Credentials

To use this node, you need a Brand.dev API key:

1. Sign up for a free account at [Brand.dev](https://brand.dev)
2. Go to your [dashboard](https://brand.dev/home) and copy your API key
4. In n8n, create new credentials:
- Go to **Credentials** > **New**
- Search for "Brand.dev API"
- Paste your API key

The node will automatically test the credentials by making a test request to the Brand.dev API.

## Compatibility

This node has been tested with:
- n8n version 1.0.0 and above
- Requires n8n-workflow as a peer dependency

## Usage

### Example: Get Brand Logos and Colors
1. Get an API key from [context.dev](https://context.dev).
2. In n8n, add a new **Context.dev API** credential.
3. Paste the key. The credential's built-in test verifies it immediately.

1. Add the Brand.dev node to your workflow
2. Select **Brand** as the resource
3. Choose **Retrieve by Domain** operation
4. Enter a domain (e.g., `stripe.com`)
5. The node returns comprehensive brand data including:
- Logos (SVG, PNG formats with different variations)
- Brand colors (primary, accent, background)
- Company information
- Social media links
The key is sent as a bearer token on every request.

### Example: Take Website Screenshots
## Operations

1. Select **Screenshot / Styleguide** as the resource
2. Choose **Take Screenshot** operation
3. Enter a domain and optionally enable full-page screenshot
4. Get a high-quality screenshot URL
### News

| Operation | Endpoint |
|---|---|
| Search company news | `POST /news/search` |

### Parsing

| Operation | Endpoint |
|---|---|
| Parse Bytes | `POST /parse` |

### Web Scraping

| Operation | Endpoint |
|---|---|
| Crawl Sitemap | `GET /web/scrape/sitemap` |
| Crawl Website & Scrape Markdown | `POST /web/crawl` |
| Scrape HTML | `GET /web/scrape/html` |
| Scrape Images | `GET /web/scrape/images` |
| Scrape Markdown | `GET /web/scrape/markdown` |
| Scrape Screenshot | `GET /web/screenshot` |
| Web Search | `POST /web/search` |

### Web Extraction

| Operation | Endpoint |
|---|---|
| Classify NAICS industries | `GET /web/naics` |
| Classify SIC industries | `GET /web/sic` |
| Extract a single product from a URL | `POST /brand/ai/product` |
| Extract products from a brand's website | `POST /brand/ai/products` |
| Extract Structured Website Data | `POST /web/extract` |
| Find website competitors | `GET /web/competitors` |
| Query website data using AI | `POST /brand/ai/query` |
| Scrape Fonts | `GET /web/fonts` |
| Scrape Styleguide | `GET /web/styleguide` |

### People

| Operation | Endpoint |
|---|---|
| Enrich Person | `POST /people/enrich` |
| Retrieve Person | `POST /people/retrieve` |

### Brand Intelligence

| Operation | Endpoint |
|---|---|
| Brand Search | `GET /brand/search` |
| Identify brand from transaction data | `GET /brand/transaction_identifier` |
| Retrieve brand data | `POST /brand/retrieve` |
| Retrieve brand data by company name | `GET /brand/retrieve-by-name` |
| Retrieve brand data by domain | `GET /brand/retrieve` |
| Retrieve brand data by email address | `GET /brand/retrieve-by-email` |
| Retrieve brand data by ISIN | `GET /brand/retrieve-by-isin` |
| Retrieve brand data by stock ticker | `GET /brand/retrieve-by-ticker` |
| Retrieve simplified brand data by domain | `GET /brand/retrieve-simplified` |

### Utility

| Operation | Endpoint |
|---|---|
| Prefetch brand data by email | `POST /brand/prefetch-by-email` |
| Prefetch brand data for a domain | `POST /brand/prefetch` |
| Prefetch data | `POST /utility/prefetch` |

### Monitors

| Operation | Endpoint |
|---|---|
| Create a monitor | `POST /monitors` |
| Delete a monitor | `DELETE /monitors/{monitor_id}` |
| Get a change | `GET /monitors/changes/{change_id}` |
| Get a monitor | `GET /monitors/{monitor_id}` |
| List changes | `GET /monitors/changes` |
| List changes for a monitor | `GET /monitors/{monitor_id}/changes` |
| List monitor runs | `GET /monitors/{monitor_id}/runs` |
| List monitors | `GET /monitors` |
| List runs | `GET /monitors/runs` |
| Monitor credit usage | `GET /monitors/credit-usage` |
| Monitor limits | `GET /monitors/limits` |
| Retrieve a monitor run | `GET /monitors/{monitor_id}/runs/{run_id}` |
| Rotate a monitor webhook secret | `POST /monitors/{monitor_id}/webhook/rotate-secret` |
| Run a monitor now | `POST /monitors/{monitor_id}/run` |
| Update a monitor | `PATCH /monitors/{monitor_id}` |

### Batch

| Operation | Endpoint |
|---|---|
| Cancel a batch | `POST /batch/{batch_id}/cancel` |
| Delete a batch | `DELETE /batch/{batch_id}` |
| Get a batch | `GET /batch/{batch_id}` |
| Get batch results | `GET /batch/{batch_id}/results` |
| List batches | `GET /batch/list` |
| Submit a batch | `POST /batch/submit` |

## Testing against the live API

The package ships a conformance suite that exercises the node's operations against the real API and
prints a pass/fail line for each. Requests are assembled from the **built node's own routing**, so a
green run is evidence about the published artifact rather than a parallel client.

```sh
npm run build
CONTEXT_DEV_API_KEY=your-key npm run test:live
```

Read-only operations run by default; cache-warming and mutating ones are opt-in. See
[`tests/live/README.md`](tests/live/README.md) for flags and for enabling the operations that need
record ids or sample values.

### Tips
## Compatibility

- Use the **Additional Fields** to customize API requests with optional parameters
- Combine with other n8n nodes to enrich your data pipelines
- The node supports n8n's usable as AI tool feature for AI-powered workflows
Requires n8n with `n8nNodesApiVersion: 1`. The node is declarative — every operation is described
as routing metadata and executed by n8n's HTTP engine, with no custom execute step.

## Resources

- [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
- [Brand.dev API Documentation](https://docs.brand.dev)
- [Brand.dev API Reference](https://docs.brand.dev/api-reference)
- [GitHub Repository](https://github.com/nikhilrado/brand-dev-n8n)
- [Context.dev API documentation](https://docs.context.dev)
- Support: hello@context.dev

## License

Expand Down
75 changes: 74 additions & 1 deletion agents.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,75 @@
run `npm run dev` after installing dependencies to start the development server and test in browser
# Agent context — n8n-nodes-context-dev

## Read this first

`nodes/` and `credentials/` are kept in lockstep with the Context.dev API contract and are
maintained as a set, not file by file. Before changing anything under them, open an issue describing
the mismatch you found — a local edit to one resource file is likely to be replaced wholesale the
next time the node is synced to the API.

Safe to edit directly: `package.json`, `.github/`, `CHANGELOG.md`, `tests/live/fixtures.json`.

## What the node is

A declarative n8n community node: no `execute()` method. Every operation is an entry in an
`INodeProperties[]` array with `routing` metadata, and n8n's HTTP engine performs the request.

- **53 operations** across 9 resources
- Base URL `https://api.context.dev/v1`, bearer auth
- One file per resource under `nodes/ContextDev/resources/`

| Resource | Display name | Operations |
|---|---|---|
| `news` | News | 1 |
| `parsing` | Parsing | 1 |
| `webScraping` | Web Scraping | 7 |
| `webExtraction` | Web Extraction | 9 |
| `people` | People | 2 |
| `brandIntelligence` | Brand Intelligence | 9 |
| `utility` | Utility | 3 |
| `monitors` | Monitors | 15 |
| `batch` | Batch | 6 |

## Layout

```
credentials/
ContextdevApi.credentials.ts — API key credential + credential test
nodes/ContextDev/
ContextDev.node.ts — node class: resource dropdown, requestDefaults, spreads
ContextDev.node.json — n8n codex: categories, docs link, search aliases
resources/<name>/index.ts — INodeProperties[] for one resource
tests/live/
run-live.mjs — live conformance runner (drives the built node in dist/)
fixtures.json — per-operation arguments and expected statuses
```

## Routing conventions

- query params → `routing.request.qs`; booleans serialise as `"true"`/`"false"`
- body params → `routing.send.property` with the dotted path
- deep-object query → a `collection` field whose sub-fields are the leaf segments
- path params → no field routing; the operation URL interpolates `$parameter["name"]`
- raw binary bodies → a binary input plus a `sendBinaryBody` preSend hook
- optional fields use omit-empty expressions so an unset field is never sent

## Verifying a change

```sh
npm run lint # n8n eslint rules (must be clean for n8n Cloud verification)
npm run build # tsc → dist/, copies icons and the codex
CONTEXT_DEV_API_KEY=... npm run test:live # live conformance against the real API
```

The live suite assembles its requests from the **built node in `dist/`**, so it tests the artifact
that ships rather than a parallel client. Read-only operations run by default; see
`tests/live/README.md`.

## Common traps

- Editing a resource file to add a single operation. Resource files are maintained as a set against
the API contract; a one-off addition here will not survive the next sync.
- Renaming an operation `value` or the credential `name`. These are load-bearing identifiers:
changing one breaks every saved workflow or credential in the wild.
- Adding an assertion that restates the API contract (endpoint URLs, enum values, parameter names).
Those are verified upstream before the node is synced; a copy here only goes stale.
Loading