{"id":16760291,"url":"https://github.com/roccomuso/is-apple","last_synced_at":"2026-05-21T10:05:02.133Z","repository":{"id":57276943,"uuid":"133522651","full_name":"roccomuso/is-apple","owner":"roccomuso","description":"Verify that a request is from Apple crawlers using DNS verification steps","archived":false,"fork":false,"pushed_at":"2019-01-05T17:17:56.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T09:01:47.032Z","etag":null,"topics":["apple","bot","crawler","dns","ip","js","nodejs"],"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-05-15T13:46:26.000Z","updated_at":"2019-01-05T17:17:57.000Z","dependencies_parsed_at":"2022-08-25T04:11:23.174Z","dependency_job_id":null,"html_url":"https://github.com/roccomuso/is-apple","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-apple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fis-apple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fis-apple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fis-apple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roccomuso","download_url":"https://codeload.github.com/roccomuso/is-apple/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847061,"owners_count":20357317,"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":["apple","bot","crawler","dns","ip","js","nodejs"],"created_at":"2024-10-13T04:22:59.704Z","updated_at":"2026-05-21T10:04:57.097Z","avatar_url":"https://github.com/roccomuso.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# is-apple\n\n[![NPM Version](https://img.shields.io/npm/v/is-apple.svg)](https://www.npmjs.com/package/is-apple)\n[![Build Status](https://travis-ci.org/roccomuso/is-apple.svg?branch=master)](https://travis-ci.org/roccomuso/is-apple)\n![node](https://img.shields.io/node/v/is-apple.svg)\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 Apple crawlers using Apple's DNS verification steps\n\nYou may wish to verify that a web crawler accessing your server is Applebot (or another Apple user-agent) and not spammers or other bots scraping your site while claiming to be Applebot. 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 Apple.\n\n\n## Install\n\n`npm install --save is-apple`\n\n## Example\n\n```javascript\nconst isApple = require('is-apple')\n\nlet ip = '17.58.98.240'\nisApple(ip).then((outcome) =\u003e {\n  if (outcome) {\n    // it's apple.\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  isApple(ip).then(outcome =\u003e {\n    if (outcome) {\n      res.status(404).text('Nothing to scan') // block apple 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-apple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froccomuso%2Fis-apple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Fis-apple/lists"}