{"id":16760334,"url":"https://github.com/roccomuso/is-bing","last_synced_at":"2025-08-27T22:09:30.466Z","repository":{"id":57276980,"uuid":"131153096","full_name":"roccomuso/is-bing","owner":"roccomuso","description":"Verify that a request is from Bing crawlers using Bing's DNS verification steps","archived":false,"fork":false,"pushed_at":"2022-12-24T23:02:59.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T15:11:27.219Z","etag":null,"topics":["bing","bot","check","crawler","dns","ip","js","nodejs","verify"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/roccomuso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-26T12:34:18.000Z","updated_at":"2023-03-04T06:07:22.000Z","dependencies_parsed_at":"2023-01-30T21:30:56.998Z","dependency_job_id":null,"html_url":"https://github.com/roccomuso/is-bing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fis-bing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fis-bing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fis-bing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fis-bing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roccomuso","download_url":"https://codeload.github.com/roccomuso/is-bing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247947819,"owners_count":21023058,"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":["bing","bot","check","crawler","dns","ip","js","nodejs","verify"],"created_at":"2024-10-13T04:23:09.458Z","updated_at":"2025-04-10T17:37:25.230Z","avatar_url":"https://github.com/roccomuso.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# is-bing\n\n[![NPM Version](https://img.shields.io/npm/v/is-bing.svg)](https://www.npmjs.com/package/is-bing)\n[![Build Status](https://travis-ci.org/roccomuso/is-bing.svg?branch=master)](https://travis-ci.org/roccomuso/is-bing)\n![node](https://img.shields.io/node/v/is-bing.svg)\n[![Dependency Status](https://david-dm.org/roccomuso/is-bing.png)](https://david-dm.org/roccomuso/is-bing)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\u003e Verify that a request is from Bing crawlers using Bing's DNS verification steps\n\nYou may wish to verify that a web crawler accessing your server is Bingbot (or another Bing user-agent) and not spammers or other bots scraping your site while claiming to be Bingbot. Since you cannot rely on the `User-Agent` header which is easily spoofed, you need to use DNS look up to verify that the IP address belongs to Bing.\n\nThis library implements Bing's own verification steps [outlined here](https://blogs.bing.com/webmaster/2012/08/31/how-to-verify-that-bingbot-is-bingbot/).\n\n## Install\n\n`npm install --save is-bing`\n\n## Example\n\n```javascript\nconst isBing = require('is-bing')\n\nlet ip = '157.55.33.18'\nisBing(ip).then((outcome) =\u003e {\n  if (outcome) {\n    // it's bing.\n  }\n}).catch(console.error)\n```\n\n### Example with express\n\n```javascript\napp.enable('trust proxy')\n\napp.use((req, res, next) =\u003e {\n  let ip = req.ip || req.connection.remoteAddress\n  isBing(ip).then(outcome =\u003e {\n    if (outcome) {\n      res.status(404).text('Nothing to scan') // block bing crawler\n    } else {\n      next() // it's a user\n    }\n  })\n})\n```\n\n## Tests\n\n`npm test`\n\n## License\n\nMIT\n\n## Author\n\nRocco Musolino [@roccomuso](https://twitter.com/roccomuso)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Fis-bing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froccomuso%2Fis-bing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Fis-bing/lists"}