{"id":45034,"library":"gpt-researcher","title":"GPT Researcher WebSocket Client","description":"The gpt-researcher npm package (v1.0.27) is a WebSocket client for interacting with GPT Researcher, an open deep research agent. It enables sending research tasks and receiving detailed reports via WebSocket connection to a local or remote GPT Researcher server. The package is in active development with regular updates. Key differentiators: provides structured log data during research process, supports various report types and sources, and is designed for easy integration into Node.js applications. Requires a running GPT Researcher backend server (Python or Docker).","status":"active","version":"1.0.27","language":"javascript","source_language":"en","source_url":"https://github.com/assafelovic/gpt-researcher","tags":["javascript","gpt-researcher","websocket","ai","research"],"install":[{"cmd":"npm install gpt-researcher","lang":"bash","label":"npm"},{"cmd":"yarn add gpt-researcher","lang":"bash","label":"yarn"},{"cmd":"pnpm add gpt-researcher","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"WebSocket library for client-server communication","package":"ws","optional":false}],"imports":[{"note":"This package uses CommonJS. ESM import is not supported directly.","wrong":"import GPTResearcher from 'gpt-researcher'","symbol":"GPTResearcher","correct":"const GPTResearcher = require('gpt-researcher')"},{"note":"Default export only. Named destructure from require will fail.","wrong":"const { GPTResearcher } = require('gpt-researcher')","symbol":"GPTResearcher","correct":"import GPTResearcher from 'gpt-researcher'"},{"note":"You must use the 'new' keyword to instantiate.","wrong":"const researcher = GPTResearcher({...})","symbol":"GPTResearcher","correct":"const researcher = new GPTResearcher({...})"}],"quickstart":{"code":"const GPTResearcher = require('gpt-researcher');\n\nconst researcher = new GPTResearcher({\n  host: 'http://localhost:8000',\n  logListener: (data) => console.log('Log:', data)\n});\n\nresearcher.sendMessage({\n  task: 'What is the capital of France?'\n});","lang":"javascript","description":"Basic usage of GPTResearcher: create instance with host and logListener, then send a research task."},"warnings":[{"fix":"Ensure GPT Researcher server (Python or Docker) is running on the specified host and port.","message":"Requires a running GPT Researcher backend server","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use require() instead of import.","message":"The package uses CommonJS only. ESM imports will fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use 'task' instead of 'query'.","message":"The 'query' parameter in sendMessage replaced by 'task' in v1.0.0","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Always provide a logListener to monitor research progress.","message":"logListener is optional but if not provided, logs are silently dropped","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Make sure the server is reachable before creating a GPTResearcher instance.","message":"WebSocket connection is established on instantiation, not lazily","severity":"breaking","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'activ':50 'agent':25 'ai':94 'applic':78 'backend':84 'client':4,15 'connect':37 'data':60 'deep':23 'design':72 'detail':33 'develop':51 'differenti':56 'docker':88 'easi':74 'enabl':27 'gpt':1,7,19,43,82,91 'gpt-research':6,90 'integr':75 'interact':17 'javascript':89 'key':55 'local':40 'log':59 'node.js':77 'npm':9 'open':22 'packag':10,47 'process':63 'provid':57 'python':86 'receiv':32 'regular':53 'remot':42 'report':34,66 'requir':79 'research':2,8,20,24,29,44,62,83,92,95 'run':81 'send':28 'server':45,85 'sourc':69 'structur':58 'support':64 'task':30 'type':67 'updat':54 'v1.0.27':11 'various':65 'via':35 'websocket':3,14,36,93","created_at":"2026-06-07T12:53:03.030700+00:00","updated_at":"2026-06-07T16:53:16.645980+00:00","problems":[{"fix":"Start the backend server (e.g., using Docker: docker run -p 8000:8000 gptresearcher/gpt-researcher).","cause":"GPT Researcher backend server is not running or not accessible.","error":"Error: connect ECONNREFUSED 127.0.0.1:8000"},{"fix":"Use 'const GPTResearcher = require(\"gpt-researcher\");' then 'const researcher = new GPTResearcher({...});'.","cause":"Using destructured require or missing 'new' keyword.","error":"TypeError: GPTResearcher is not a constructor"},{"fix":"Use require() instead of import.","cause":"Attempting to use ES import in a CommonJS environment.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Wait for the 'open' event or ensure the server is running before sending.","cause":"sendMessage was called before WebSocket connection is fully open.","error":"TypeError: researcher.sendMessage is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/assafelovic/gpt-researcher#readme","github":"https://github.com/assafelovic/gpt-researcher","docs":null,"changelog":null,"pypi":null,"npm":"gpt-researcher","openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","search"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}