# API Keys Source: https://docs.new-gen.ai/api-keys Learn how to create and manage your API keys # Getting Your API Key To use our API, you'll need an API key. [Email us](mailto:founders@new-gen.ai) and we'll help you get set up. ## Using Your API Key Include your API key in the `Authorization` header with all API requests: ```bash theme={null} curl -H "Authorization: YOUR_API_KEY" https://api.new-gen.ai/v1/products/search ``` ## Security Best Practices * Never share your API key * Don't commit API keys to version control * Rotate keys periodically * Use different keys for development and production # Filter Products Source: https://docs.new-gen.ai/api-reference/endpoint/filter-products Retrieve a product using query parameter filters. We currently only support filtering a product by the URL of it's brand product details page (PDP). ## Filter Products by URL ```bash theme={null} curl GET /api/v1/products?url={url} ``` Retrieve a product by its URL. ### Query Parameters | Parameter | Type | Description | | ------------------ | ------- | ---------------------------------------------------- | | url | string | The product URL to fetch | | include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) | ### Response Object ```json theme={null} { "pdp": { "id": string, "url": string, "name": string, "desc": string, "media": [ { "url": string, "type": string } ], "brands": [string], "price_label": string, "raw_data": { "strippedHtml": string, "jsons": { "ld_json": { data }, "props_data": { data } } } } } ``` # Get Product Source: https://docs.new-gen.ai/api-reference/endpoint/get-product Retrieve a specific product using either ID. ## Get Product by ID ```bash theme={null} curl GET /api/v1/products/:id ``` Retrieve a product by its ID. ### Path Parameters | Parameter | Type | Description | | --------- | ------ | ----------- | | id | string | Product ID | ### Query Parameters | Parameter | Type | Description | | ------------------ | ------- | ---------------------------------------------------- | | include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) | ### Response Object ```json theme={null} { "pdp": { "id": string, "url": string, "name": string, "desc": string, "media": [ { "url": string, "type": string } ], "brands": [string], "price_label": string, "raw_data": { "strippedHtml": string, "jsons": { "ld_json": { data }, "props_data": { data } } } } } ``` # Search Products Source: https://docs.new-gen.ai/api-reference/endpoint/search Search for products using text queries and LLM reranking. ```bash theme={null} curl GET /api/v1/products/search ``` ### Query Parameters | Parameter | Type | Description | | ------------------ | ------- | ------------------------------------------------------ | | q | string | Search query text (required) | | brand\_url | string | Base brand URL to filter by, e.g., nike.com (optional) | | limit | number | Maximum number of results (default: 20) | | include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) | ### Response Object ```json theme={null} { "products": [ { "pdp": { "id": string, "url": string, "name": string, "desc": string, "media": [ { "url": string, "type": string } ], "brands": [string], "price_label": string, "raw_data": { "strippedHtml": string, "jsons": { "ld_json": { data }, "props_data": { data } } } } } ] } ``` # Endpoints Source: https://docs.new-gen.ai/api-reference/introduction Complete reference of all available endpoints All API endpoints are protected with API key authentication. You must include a valid API key in the Authorization header with each request. [Email us](mailto:founders@new-gen.ai) and we'll help you get set up. ## Authentication To authenticate with the API, include your API key in the `Authorization` header of your requests. ### Example ```bash theme={null} curl -X GET "https://api.new-gen.ai/v1/products/search?q=shoes" \ -H "Authorization: YOUR_API_KEY" ``` If you're using a client library: ```javascript theme={null} // JavaScript example const response = await fetch( "https://api.new-gen.ai/v1/products/search?q=shoes", { headers: { Authorization: "YOUR_API_KEY", }, }, ); ``` ```python theme={null} # Python example import requests headers = { 'Authorization': 'YOUR_API_KEY' } response = requests.get('https://api.new-gen.ai/v1/products/search?q=shoes', headers=headers) ``` ### Obtaining an API Key [Email us](mailto:founders@new-gen.ai) to obtain an API key and we'll help you get set up. API keys should be kept secure and not shared. ## Product Search ```bash theme={null} curl GET /api/v1/products/search ``` Search for products using text queries and LLM reranking. ### Query Parameters | Parameter | Type | Description | | ------------------ | ------- | ------------------------------------------------------ | | q | string | Search query text (required) | | brand\_url | string | Base brand URL to filter by, e.g., nike.com (optional) | | limit | number | Maximum number of results (default: 20) | | include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) | *** ## Get a Product by ID ```bash theme={null} curl GET /api/v1/products/:id ``` Retrieve a product by its ID. ### Path Parameters | Parameter | Type | Description | | --------- | ------ | ----------- | | id | string | Product ID | ### Query Parameters | Parameter | Type | Description | | ------------------ | ------- | ---------------------------------------------------- | | include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) | *** ## Filter Products by URL ```bash theme={null} curl GET /api/v1/products?url={url} ``` Retrieve a product by its URL. ### Query Parameters | Parameter | Type | Description | | ------------------ | ------- | ---------------------------------------------------- | | url | string | The product URL to fetch | | include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) | *** ## Health Check ```bash theme={null} GET /health ``` Check API health status. # Endpoints Source: https://docs.new-gen.ai/endpoints Complete reference of all available endpoints All API endpoints are protected with API key authentication. You must include a valid API key in the Authorization header with each request. [Email us](mailto:founders@new-gen.ai) and we'll help you get set up. ## Product Search ```bash theme={null} curl GET /api/v1/products/search ``` Search for products using text queries and LLM reranking. ### Query Parameters | Parameter | Type | Description | | ------------------ | ------- | ------------------------------------------------------ | | q | string | Search query text (required) | | brand\_url | string | Base brand URL to filter by, e.g., nike.com (optional) | | limit | number | Maximum number of results (default: 20) | | include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) | *** ## Get a Product by ID ```bash theme={null} curl GET /api/v1/products/:id ``` Retrieve a product by its ID. ### Path Parameters | Parameter | Type | Description | | --------- | ------ | ----------- | | id | string | Product ID | ### Query Parameters | Parameter | Type | Description | | ------------------ | ------- | ---------------------------------------------------- | | include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) | *** ## Filter Products by URL ```bash theme={null} curl GET /api/v1/products?url={url} ``` Retrieve a product by its URL. ### Query Parameters | Parameter | Type | Description | | ------------------ | ------- | ---------------------------------------------------- | | url | string | The product URL to fetch | | include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) | *** ## Health Check ```bash theme={null} GET /health ``` Check API health status. # Introduction Source: https://docs.new-gen.ai/introduction New Gen helps you and your agents find products on the internet to buy New Gen Product Search Hero Welcome to the New Generation Product API. This API has endpoints that allow you to access high quality, direct product data from merchants, without having to set up your own ETL and data scraping pipelines. You can: * search our aggregated product catalog using vector similarity and LLM reranking techniques (by brand or across brands) * get product information for a specific, known product (by ID) * filter products to retrieve a specific product using a brand's PDP URL Our API is currently in private beta and we'd love to partner with you on building agentic commerce applications. We plan to continue expanding our product catalog and API endpoints to provide the canonical source for anything you can buy and sell on the internet, including brand designs and guidelines. To use our API, you'll need an API key. [Email us](mailto:founders@new-gen.ai) and we'll help you get set up with an API key and test account. Prefer having a conversation with our docs? Head over to our [custom GPT](https://chatgpt.com/g/g-682a93f2540c8191b6ee0925d37e9d8c-new-gen-api-guide) with your questions!