Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

bing-search-service.js 535 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
  1. var apiHandler = require('./api-handler-service');
  2. const BING_SEARCH_API_URL = "https://api.cognitive.microsoft.com/bing/v5.0/search/",
  3. BING_SEARCH_API_KEY = process.env.BING_SEARCH_API_KEY;
  4. var headers = { "Ocp-Apim-Subscription-Key": BING_SEARCH_API_KEY }
  5. module.exports = {
  6. findArticles: (query) => {
  7. return apiHandler.getResponse(BING_SEARCH_API_URL, { "q": query + " site:wikipedia.org", "form": "BTCSWR" }, headers)
  8. .then(result => { return JSON.parse(result); }, err => { return err });
  9. }
  10. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...