{"id":13435541,"url":"https://github.com/transitive-bullshit/bing-chat","last_synced_at":"2025-03-01T22:32:21.595Z","repository":{"id":65776284,"uuid":"599496818","full_name":"transitive-bullshit/bing-chat","owner":"transitive-bullshit","description":"Node.js client for Bing's new AI-powered search. It's like ChatGPT on steroids 🔥","archived":true,"fork":false,"pushed_at":"2023-10-10T04:56:02.000Z","size":336,"stargazers_count":1219,"open_issues_count":46,"forks_count":122,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-02-21T17:51:12.412Z","etag":null,"topics":["ai","bing","chatbot","chatgpt","search"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transitive-bullshit.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["transitive-bullshit"]}},"created_at":"2023-02-09T09:05:57.000Z","updated_at":"2025-02-08T11:40:21.000Z","dependencies_parsed_at":"2024-01-14T09:58:16.146Z","dependency_job_id":"7889a626-b6ac-4bd4-bb5b-77a82c16c9d6","html_url":"https://github.com/transitive-bullshit/bing-chat","commit_stats":{"total_commits":21,"total_committers":4,"mean_commits":5.25,"dds":"0.23809523809523814","last_synced_commit":"d2553b5b8c6019ae0a0b46b7fce2491899a57aa7"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fbing-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fbing-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fbing-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fbing-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transitive-bullshit","download_url":"https://codeload.github.com/transitive-bullshit/bing-chat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241435175,"owners_count":19962400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bing","chatbot","chatgpt","search"],"created_at":"2024-07-31T03:00:36.689Z","updated_at":"2025-03-01T22:32:21.236Z","avatar_url":"https://github.com/transitive-bullshit.png","language":"TypeScript","funding_links":["https://github.com/sponsors/transitive-bullshit"],"categories":["TypeScript","SDK, Libraries, Frameworks","HarmonyOS","CLIs"],"sub_categories":["JavaScript/Typescript","Windows Manager"],"readme":"# Bing Chat API \u003c!-- omit in toc --\u003e\n\n\u003e Node.js client for the unofficial Bing Chat API. It's like ChatGPT on steroids 🔥\n\n[![NPM](https://img.shields.io/npm/v/bing-chat.svg)](https://www.npmjs.com/package/bing-chat) [![Build Status](https://github.com/transitive-bullshit/bing-chat/actions/workflows/test.yml/badge.svg)](https://github.com/transitive-bullshit/bing-chat/actions/workflows/test.yml) [![MIT License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/transitive-bullshit/bing-chat/blob/main/license) [![Prettier Code Formatting](https://img.shields.io/badge/code_style-prettier-brightgreen.svg)](https://prettier.io)\n\n- [Intro](#intro)\n- [Demo](#demo)\n- [Install](#install)\n- [Usage](#usage)\n- [Projects](#projects)\n- [Compatibility](#compatibility)\n- [Credit](#credit)\n- [Related](#related)\n- [License](#license)\n\n## Intro\n\nThis package is a Node.js wrapper around Bing Chat by Microsoft. TS batteries included. ✨\n\n\u003e **Warning**\n\u003e This package is a reverse-engineered hack. I do not expect it to continue working long-term, and it is not meant for use in production. I'm building this in public, and you can follow the progress on Twitter [@transitive_bs](https://twitter.com/transitive_bs).\n\n## Demo\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Example conversation\" src=\"/media/demo.gif\"\u003e\n  \u003ci\u003e(30s conversation demo)\u003c/i\u003e\n\u003c/p\u003e\n\n## Install\n\n```bash\nnpm install bing-chat\n```\n\nMake sure you're using `node \u003e= 18` so `fetch` is available.\n\n## Usage\n\n**You need access to Bing Chat OR a valid cookie from someone who has access**.\n\nThe cookie you need from Bing is the `_U` cookie (or just all of the cookies concatenated together; both will work).\n\n```ts\nimport { BingChat } from 'bing-chat'\n\nasync function example() {\n  const api = new BingChat({\n    cookie: process.env.BING_COOKIE\n  })\n\n  const res = await api.sendMessage('Hello World!')\n  console.log(res.text)\n}\n```\n\nYou can follow-up messages to continue the conversation. See `demos/demo-conversation.ts` for an example.\n\nNote that Bing Chat conversations expire after about 20 minutes, so they're not meant to be long-term objects.\n\nYou can add streaming via the `onProgress` handler:\n\n```ts\nconst res = await api.sendMessage('Write a 500 word essay on frogs.', {\n  // print the partial response as the AI is \"typing\"\n  onProgress: (partialResponse) =\u003e console.log(partialResponse.text)\n})\n\n// print the full text at the end\nconsole.log(res.text)\n```\n\nSee `demos/demo-on-progress.ts` for a full example of streaming support.\n\nYou can also add the the parameter `variant` to the `sendMessage` function to change the variant of the AI. The default is `Balanced`, but you can also use `Precise` or `Creative`.\n\n```ts\nconst res = await api.sendMessage('Write a 500 word essay on frogs.', {\n  // change the variant to 'Precise'\n  variant: 'Creative'\n})\n```\n\n## Projects\n\nIf you create a cool integration, feel free to open a PR and add it to the list.\n\n## Compatibility\n\n- This package is ESM-only.\n- This package supports `node \u003e= 18`.\n- This module assumes that `fetch` is installed globally.\n- If you want to build a website using `bing-chat`, we recommend using it only from your backend API\n\n## Credit\n\n- Thanks to [waylaidwanderer](https://github.com/waylaidwanderer) and [canfam](https://github.com/canfam) for helping to reverse-engineer the API 💪\n\n## Related\n\n- [chatgpt](https://github.com/transitive-bullshit/chatgpt-api) - Node.js client for the unofficial ChatGPT API. Same author as this package.\n- [discord](https://discord.gg/v9gERj825w) - Join our discord server for hackers building on top of ChatGPT / Bing / LLMs.\n\n## License\n\nMIT © [Travis Fischer](https://transitivebullsh.it)\n\nIf you found this project interesting, please consider [sponsoring me](https://github.com/sponsors/transitive-bullshit) or \u003ca href=\"https://twitter.com/transitive_bs\"\u003efollowing me on twitter \u003cimg src=\"https://storage.googleapis.com/saasify-assets/twitter-logo.svg\" alt=\"twitter\" height=\"24px\" align=\"center\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Fbing-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransitive-bullshit%2Fbing-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Fbing-chat/lists"}