Skip to content

ottino/bingchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API for Bing Chat

This API is a chat bot for querying Bing Chat with a Node.js app. I am using the 'chatgpt-api' library from the 'transitive-bullshit' repository.

How to install

1) Create a new project with Node.js and you need the following libreries:

libreary npm
dotenv npm install dotenv
express npm install express
BingChat npm install bing-chat --save

2) Create a settings.env file and insert your BingChat cookie.

How to retrieve the cookie:

  1. Log in to BingChat in your web browser

  2. Press F12 (developer tools)

  3. Navigate to the "Application" tab

  4. Look for the "Cookies" option and copy the "_U" key

    image

3) Run on your terminal

  node app.js 

You see:

image

How to use

Put this URL in your browser:

http://localhost:3000/chat?phrase=XXXXX

XXXXX= query

Reference

https://github.com/transitive-bullshit/bing-chat/