{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-v2/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Explore the API","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"explore-the-api","__idx":0},"children":["Explore the API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are several ways to explore and test the HG API — from AI-powered tools to visual clients. Pick the one that fits your workflow."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"try-it-console","__idx":1},"children":["Try-it Console"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The fastest way to test. Every endpoint in these docs has a built-in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Try-it"]}," console on the right side of the page."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Navigate to any endpoint (e.g., Enrich Companies)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Try it"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter your API key in the Authorization header"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Edit the request body"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Send"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You'll see the response right in the browser — no setup needed. Great for quick tests and verifying filter syntax."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"claude-code","__idx":2},"children":["Claude Code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://claude.ai/claude-code"},"children":["Claude Code"]}," is an AI coding assistant that runs in your terminal. It can call the HG API directly, iterate on requests, and help you build integrations."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"setup","__idx":3},"children":["Setup"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add your API key as an environment variable:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"export HG_API_KEY=\"your_api_key_here\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-prompts","__idx":4},"children":["Example prompts"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once Claude Code is running, you can ask it to explore the API conversationally:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["\"Call the HG API to enrich walmart.com with firmographics and technographics\""]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["\"Search for US companies with 1000+ employees using Salesforce\""]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["\"Look up the vendor ID for Microsoft in the HG catalog\""]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["\"Match these company names to HG records: Ford, Google, Walmart\""]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["\"Write a Python script that enriches a list of domains from a CSV file\""]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Claude Code will make the API calls, show you the responses, and help you refine your queries — all from the terminal."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"building-integrations","__idx":5},"children":["Building integrations"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Claude Code is especially useful for prototyping:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"> \"Write a Python script that reads domains from domains.csv, \n   enriches each one with firmographics via the HG API, \n   and writes the results to enriched.csv\"\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It will generate working code, test it against the API, and iterate until it works."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"claude-with-mcp","__idx":6},"children":["Claude with MCP"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://modelcontextprotocol.io"},"children":["Model Context Protocol (MCP)"]}," lets Claude call the HG API as a tool directly in conversation. Instead of copying and pasting API responses, Claude can query HG data on demand."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"hg-official-mcp-server","__idx":7},"children":["HG Official MCP Server"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HG Insights offers an official MCP server with full access to HG data. It's currently in early access — ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://phoenix.hginsights.com/contact"},"children":["request access here"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"build-your-own-mcp-server","__idx":8},"children":["Build Your Own MCP Server"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you prefer to build your own, you can wrap the HG API endpoints as MCP tools. This is a lightweight DIY approach using your existing API key. The example below shows how to set one up."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once configured, Claude can query HG data naturally:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["\"What's Walmart's tech stack?\" → Claude calls Enrich with technographics"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["\"Find companies using AWS with $1M+ in cloud spend\" → Claude calls Search"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["\"Who is the parent company of Google?\" → Claude calls Enrich with firmographics"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"setting-up-a-custom-mcp-server","__idx":9},"children":["Setting up a custom MCP server"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A custom MCP server for HG API is a small script (~100 lines) that exposes the API endpoints as tools:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from mcp.server import Server\nfrom mcp.types import Tool\nimport requests\nimport os\n\nserver = Server(\"hg-insights\")\nAPI_KEY = os.environ[\"HG_API_KEY\"]\nBASE_URL = \"https://api.hginsights.com/data-api/v2\"\nHEADERS = {\n    \"Authorization\": f\"Bearer {API_KEY}\",\n    \"Content-Type\": \"application/json\"\n}\n\n@server.tool()\nasync def enrich_company(\n    domains: list[str],\n    fields: list[str] = [\"firmographics\", \"technographics\", \"spend\"]\n) -> dict:\n    \"\"\"Enrich companies with firmographics, technographics, and spend data.\"\"\"\n    response = requests.post(\n        f\"{BASE_URL}/companies/enrich\",\n        headers=HEADERS,\n        json={\"companies\": {\"domains\": domains}, \"fields\": fields}\n    )\n    return response.json()\n\n@server.tool()\nasync def match_companies(\n    companies: list[dict]\n) -> dict:\n    \"\"\"Match companies by name, domain, and/or country to find their HG records.\"\"\"\n    response = requests.post(\n        f\"{BASE_URL}/companies/match\",\n        headers=HEADERS,\n        json={\"companies\": companies, \"limit\": 3}\n    )\n    return response.json()\n\n@server.tool()\nasync def search_companies(\n    filters: dict,\n    limit: int = 10\n) -> dict:\n    \"\"\"Search for companies using firmographic, technographic, spend, and intent filters.\"\"\"\n    response = requests.post(\n        f\"{BASE_URL}/companies/search\",\n        headers=HEADERS,\n        json={\n            \"fields\": [\"id\", \"name\", \"domain\"],\n            \"filters\": filters,\n            \"limit\": limit\n        }\n    )\n    return response.json()\n\n@server.tool()\nasync def lookup_catalog(\n    catalog_type: str,\n    name: str\n) -> dict:\n    \"\"\"Look up vendors, products, categories, or other taxonomy data by name.\"\"\"\n    response = requests.get(\n        f\"{BASE_URL}/catalog/{catalog_type}\",\n        headers=HEADERS,\n        params={\"name\": name, \"limit\": 10}\n    )\n    return response.json()\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"connecting-to-claude-desktop","__idx":10},"children":["Connecting to Claude Desktop"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the server to your Claude Desktop config (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["claude_desktop_config.json"]},"):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"mcpServers\": {\n    \"hg-insights\": {\n      \"command\": \"python\",\n      \"args\": [\"path/to/hg_mcp_server.py\"],\n      \"env\": {\n        \"HG_API_KEY\": \"your_api_key_here\"\n      }\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Restart Claude Desktop and you can start asking questions about any company's data."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"chatgpt-and-other-llms","__idx":11},"children":["ChatGPT and Other LLMs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use any LLM to help you explore the API and generate requests, even without MCP."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"share-the-docs","__idx":12},"children":["Share the docs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Give the LLM the URL to these docs or paste the relevant guide content:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Here is the HG Insights API documentation: https://data-docs.hginsights.com\n\nI want to find all US companies with 500+ employees that use Salesforce. \nHelp me build the API request.\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"share-the-openapi-spec","__idx":13},"children":["Share the OpenAPI spec"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more precise help, share the OpenAPI spec directly:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Here is the HG API OpenAPI spec. Help me build a request to enrich \ngoogle.com with firmographics and technographics filtered by Salesforce products.\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The LLM will generate the correct JSON body, curl command, or code in your preferred language."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"tips-for-better-results","__idx":14},"children":["Tips for better results"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Be specific about what you want: \"enrich walmart.com\" vs \"find companies using AWS\""]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Mention which endpoint to use if you know it"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ask the LLM to include all available filter options so you can remove what you don't need"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ask it to generate code in your language (Python, Node.js, etc.)"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"postman","__idx":15},"children":["Postman"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you prefer a visual API client, import the OpenAPI spec to get all endpoints pre-configured."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open Postman and click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Import"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Link"]}," and paste: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://data-docs.hginsights.com/v2/openapi.yaml"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Postman creates a collection with all endpoints ready to use"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set your API key in the collection's Authorization tab (Bearer Token)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Start making requests"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"tips","__idx":16},"children":["Tips"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set the API key once at the collection level so it applies to all requests"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Save example requests for common queries you run often"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use environment variables for different API keys (dev, prod)"]}]}]},"headings":[{"value":"Explore the API","id":"explore-the-api","depth":1},{"value":"Try-it Console","id":"try-it-console","depth":2},{"value":"Claude Code","id":"claude-code","depth":2},{"value":"Setup","id":"setup","depth":3},{"value":"Example prompts","id":"example-prompts","depth":3},{"value":"Building integrations","id":"building-integrations","depth":3},{"value":"Claude with MCP","id":"claude-with-mcp","depth":2},{"value":"HG Official MCP Server","id":"hg-official-mcp-server","depth":3},{"value":"Build Your Own MCP Server","id":"build-your-own-mcp-server","depth":3},{"value":"Setting up a custom MCP server","id":"setting-up-a-custom-mcp-server","depth":3},{"value":"Connecting to Claude Desktop","id":"connecting-to-claude-desktop","depth":3},{"value":"ChatGPT and Other LLMs","id":"chatgpt-and-other-llms","depth":2},{"value":"Share the docs","id":"share-the-docs","depth":3},{"value":"Share the OpenAPI spec","id":"share-the-openapi-spec","depth":3},{"value":"Tips for better results","id":"tips-for-better-results","depth":3},{"value":"Postman","id":"postman","depth":2},{"value":"Tips","id":"tips","depth":3}],"frontmatter":{"seo":{"title":"Explore the API"}},"lastModified":"2026-04-16T18:46:44.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/v2/guides/explore-the-api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}