Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.8.0"
".": "2.9.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 37
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-758c3a2fbd5b7be61c8e6e0ad2e6a5ec30695747bb675960d888c497647d13d7.yml
openapi_spec_hash: 00002d90bde02f67e174368ae470c597
config_hash: 2bea1743c84d63bd61f8501a6ea63065
configured_endpoints: 38
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-155e4761d62255841349c0f8a01b0a9c463ea1d1f2d6c4fd8d1a75c8bef6f226.yml
openapi_spec_hash: ab91f77e7c9d992400cbc7fc8a9e76c1
config_hash: bff282047fafdad771fb7ec685f56944
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.9.0 (2026-08-05)

Full Changelog: [v2.8.0...v2.9.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.8.0...v2.9.0)

### Features

* **api:** manual updates ([bdb799c](https://github.com/context-dot-dev/context-typescript-sdk/commit/bdb799c235c805d25b4caaf591d70a5315a1e1af))

## 2.8.0 (2026-08-01)

Full Changelog: [v2.7.0...v2.8.0](https://github.com/context-dot-dev/context-typescript-sdk/compare/v2.7.0...v2.8.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ Types:

- <code><a href="./src/resources/brand.ts">BrandRetrieveResponse</a></code>
- <code><a href="./src/resources/brand.ts">BrandRetrieveSimplifiedResponse</a></code>
- <code><a href="./src/resources/brand.ts">BrandSearchResponse</a></code>

Methods:

- <code title="post /brand/retrieve">client.brand.<a href="./src/resources/brand.ts">retrieve</a>({ ...params }) -> BrandRetrieveResponse</code>
- <code title="get /brand/retrieve-simplified">client.brand.<a href="./src/resources/brand.ts">retrieveSimplified</a>({ ...params }) -> BrandRetrieveSimplifiedResponse</code>
- <code title="get /brand/search">client.brand.<a href="./src/resources/brand.ts">search</a>({ ...params }) -> BrandSearchResponse</code>

# Industry

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "context.dev",
"version": "2.8.0",
"version": "2.9.0",
"description": "The official TypeScript library for the Context Dev API",
"author": "Context Dev <hello@context.dev>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "context.dev-mcp",
"version": "2.8.0",
"version": "2.9.0",
"description": "The official MCP Server for the Context Dev API",
"author": {
"name": "Context Dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "context.dev-mcp",
"version": "2.8.0",
"version": "2.9.0",
"description": "The official MCP Server for the Context Dev API",
"author": "Context Dev <hello@context.dev>",
"types": "dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/mcp-server/src/code-tool-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const fuse = new Fuse(
'client.ai.extractProducts',
'client.brand.retrieve',
'client.brand.retrieveSimplified',
'client.brand.search',
'client.industry.retrieveNaics',
'client.industry.retrieveSic',
'client.utility.prefetch',
Expand Down
50 changes: 50 additions & 0 deletions packages/mcp-server/src/local-docs-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,56 @@ const EMBEDDED_METHODS: MethodEntry[] = [
},
},
},
{
name: 'search',
endpoint: '/brand/search',
httpMethod: 'get',
summary: 'Brand Search',
description:
'Search brands by name or domain and get back up to 10 lightweight matches (domain, name, logo), most popular first: by Tranco rank, then market cap for brands outside the Tranco list, with text relevance breaking ties. Matching is prefix-based with no typo tolerance, so it is suited to autocomplete. Only brands already in the Context.dev index are returned — use /brand/retrieve to fetch (and index) a specific domain. Free on Pro and Scale plans; costs 1 credit per request on the Free and Starter plans.',
stainlessPath: '(resource) brand > (method) search',
qualified: 'client.brand.search',
params: ['query: string;', 'tags?: string[];'],
response:
'{ results: { domain: string; logo: string; name: string; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }',
markdown:
"## search\n\n`client.brand.search(query: string, tags?: string[]): { results: object[]; key_metadata?: object; }`\n\n**get** `/brand/search`\n\nSearch brands by name or domain and get back up to 10 lightweight matches (domain, name, logo), most popular first: by Tranco rank, then market cap for brands outside the Tranco list, with text relevance breaking ties. Matching is prefix-based with no typo tolerance, so it is suited to autocomplete. Only brands already in the Context.dev index are returned — use /brand/retrieve to fetch (and index) a specific domain. Free on Pro and Scale plans; costs 1 credit per request on the Free and Starter plans.\n\n### Parameters\n\n- `query: string`\n Search term, matched against brand names and domains by prefix (e.g. 'nike', 'nike.com', 'nik').\n\n- `tags?: string[]`\n Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.\n\n### Returns\n\n- `{ results: { domain: string; logo: string; name: string; }[]; key_metadata?: { credits_consumed: number; credits_remaining: number; }; }`\n\n - `results: { domain: string; logo: string; name: string; }[]`\n - `key_metadata?: { credits_consumed: number; credits_remaining: number; }`\n\n### Example\n\n```typescript\nimport ContextDev from 'context.dev';\n\nconst client = new ContextDev();\n\nconst response = await client.brand.search({ query: 'x' });\n\nconsole.log(response);\n```",
perLanguage: {
typescript: {
method: 'client.brand.search',
example:
"import ContextDev from 'context.dev';\n\nconst client = new ContextDev({\n apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.brand.search({ query: 'x' });\n\nconsole.log(response.results);",
},
python: {
method: 'brand.search',
example:
'import os\nfrom context.dev import ContextDev\n\nclient = ContextDev(\n api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.brand.search(\n query="x",\n)\nprint(response.results)',
},
go: {
method: 'client.Brand.Search',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/context-dot-dev/context-go-sdk"\n\t"github.com/context-dot-dev/context-go-sdk/option"\n)\n\nfunc main() {\n\tclient := contextdev.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Brand.Search(context.TODO(), contextdev.BrandSearchParams{\n\t\tQuery: "x",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Results)\n}\n',
},
ruby: {
method: 'brand.search',
example:
'require "context_dev"\n\ncontext_dev = ContextDev::Client.new(api_key: "My API Key")\n\nresponse = context_dev.brand.search(query: "x")\n\nputs(response)',
},
cli: {
method: 'brand search',
example: "context-dev brand search \\\n --api-key 'My API Key' \\\n --query x",
},
php: {
method: 'brand->search',
example:
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->brand->search(\n query: 'x', tags: ['production', 'team-alpha']\n);\n\nvar_dump($response);",
},
http: {
example:
'curl https://api.context.dev/v1/brand/search \\\n -H "Authorization: Bearer $CONTEXT_DEV_API_KEY"',
},
},
},
{
name: 'retrieve_simplified',
endpoint: '/brand/retrieve-simplified',
Expand Down
6 changes: 6 additions & 0 deletions packages/mcp-server/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'get',
httpPath: '/brand/retrieve-simplified',
},
{
clientCallName: 'client.brand.search',
fullyQualifiedName: 'brand.search',
httpMethod: 'get',
httpPath: '/brand/search',
},
{
clientCallName: 'client.industry.retrieveNaics',
fullyQualifiedName: 'industry.retrieveNaics',
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const newMcpServer = async ({
new McpServer(
{
name: 'context_dev_api',
version: '2.8.0',
version: '2.9.0',
},
{
instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),
Expand Down
4 changes: 4 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ import {
BrandRetrieveResponse,
BrandRetrieveSimplifiedParams,
BrandRetrieveSimplifiedResponse,
BrandSearchParams,
BrandSearchResponse,
} from './resources/brand';
import {
Industry,
Expand Down Expand Up @@ -891,8 +893,10 @@ export declare namespace ContextDev {
Brand as Brand,
type BrandRetrieveResponse as BrandRetrieveResponse,
type BrandRetrieveSimplifiedResponse as BrandRetrieveSimplifiedResponse,
type BrandSearchResponse as BrandSearchResponse,
type BrandRetrieveParams as BrandRetrieveParams,
type BrandRetrieveSimplifiedParams as BrandRetrieveSimplifiedParams,
type BrandSearchParams as BrandSearchParams,
};

export {
Expand Down
84 changes: 84 additions & 0 deletions src/resources/brand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ export class Brand extends APIResource {
): APIPromise<BrandRetrieveSimplifiedResponse> {
return this._client.get('/brand/retrieve-simplified', { query, ...options });
}

/**
* Search brands by name or domain and get back up to 10 lightweight matches
* (domain, name, logo), most popular first: by Tranco rank, then market cap for
* brands outside the Tranco list, with text relevance breaking ties. Matching is
* prefix-based with no typo tolerance, so it is suited to autocomplete. Only
* brands already in the Context.dev index are returned — use /brand/retrieve to
* fetch (and index) a specific domain. Free on Pro and Scale plans; costs 1 credit
* per request on the Free and Starter plans.
*
* @example
* ```ts
* const response = await client.brand.search({ query: 'x' });
* ```
*/
search(query: BrandSearchParams, options?: RequestOptions): APIPromise<BrandSearchResponse> {
return this._client.get('/brand/search', { query, ...options });
}
}

export interface BrandRetrieveResponse {
Expand Down Expand Up @@ -1021,6 +1039,55 @@ export namespace BrandRetrieveSimplifiedResponse {
}
}

export interface BrandSearchResponse {
/**
* Up to 10 matching brands, most popular first. Empty when nothing matches.
*/
results: Array<BrandSearchResponse.Result>;

/**
* Metadata about the API key used for the request. Included in every response
* whenever a valid API key is provided, even when the response status is not 200.
*/
key_metadata?: BrandSearchResponse.KeyMetadata;
}

export namespace BrandSearchResponse {
export interface Result {
/**
* The brand's domain.
*/
domain: string;

/**
* Logo link URL that serves the brand's logo, generated per request for the
* calling organization.
*/
logo: string;

/**
* The brand's name. Empty string when unknown.
*/
name: string;
}

/**
* Metadata about the API key used for the request. Included in every response
* whenever a valid API key is provided, even when the response status is not 200.
*/
export interface KeyMetadata {
/**
* The number of credits consumed by this request.
*/
credits_consumed: number;

/**
* The number of credits remaining for your organization after this request.
*/
credits_remaining: number;
}
}

export type BrandRetrieveParams =
| BrandRetrieveParams.BrandRetrieveByDomainRequest
| BrandRetrieveParams.BrandRetrieveByNameRequest
Expand Down Expand Up @@ -1932,11 +1999,28 @@ export interface BrandRetrieveSimplifiedParams {
timeoutMS?: number;
}

export interface BrandSearchParams {
/**
* Search term, matched against brand names and domains by prefix (e.g. 'nike',
* 'nike.com', 'nik').
*/
query: string;

/**
* Optional comma-separated caller-defined tags for tracking this request. Tags are
* recorded on the request's usage log and can be used to filter usage on the
* dashboard usage page. Up to 20 tags, each 1-50 characters.
*/
tags?: Array<string>;
}

export declare namespace Brand {
export {
type BrandRetrieveResponse as BrandRetrieveResponse,
type BrandRetrieveSimplifiedResponse as BrandRetrieveSimplifiedResponse,
type BrandSearchResponse as BrandSearchResponse,
type BrandRetrieveParams as BrandRetrieveParams,
type BrandRetrieveSimplifiedParams as BrandRetrieveSimplifiedParams,
type BrandSearchParams as BrandSearchParams,
};
}
2 changes: 2 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export {
Brand,
type BrandRetrieveResponse,
type BrandRetrieveSimplifiedResponse,
type BrandSearchResponse,
type BrandRetrieveParams,
type BrandRetrieveSimplifiedParams,
type BrandSearchParams,
} from './brand';
export {
Industry,
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '2.8.0'; // x-release-please-version
export const VERSION = '2.9.0'; // x-release-please-version
17 changes: 17 additions & 0 deletions tests/api-resources/brand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,21 @@ describe('resource brand', () => {
timeoutMS: 1000,
});
});

// Mock server tests are disabled
test.skip('search: only required params', async () => {
const responsePromise = client.brand.search({ query: 'x' });
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

// Mock server tests are disabled
test.skip('search: required and optional params', async () => {
const response = await client.brand.search({ query: 'x', tags: ['production', 'team-alpha'] });
});
});
Loading