{"id":28376503,"url":"https://github.com/bdadam/metatag-crawler","last_synced_at":"2025-06-26T10:30:59.571Z","repository":{"id":57295772,"uuid":"46727697","full_name":"bdadam/metatag-crawler","owner":"bdadam","description":"This is a simple node.js module for scraping meta information from web pages.","archived":false,"fork":false,"pushed_at":"2019-09-25T16:28:10.000Z","size":94,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-08T13:05:01.465Z","etag":null,"topics":["crawler","metadata","nodejs","parser"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/bdadam.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-23T15:02:24.000Z","updated_at":"2023-03-07T02:44:53.000Z","dependencies_parsed_at":"2022-08-27T12:20:20.039Z","dependency_job_id":null,"html_url":"https://github.com/bdadam/metatag-crawler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bdadam/metatag-crawler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdadam%2Fmetatag-crawler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdadam%2Fmetatag-crawler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdadam%2Fmetatag-crawler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdadam%2Fmetatag-crawler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdadam","download_url":"https://codeload.github.com/bdadam/metatag-crawler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdadam%2Fmetatag-crawler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262047780,"owners_count":23250418,"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":["crawler","metadata","nodejs","parser"],"created_at":"2025-05-30T00:07:05.724Z","updated_at":"2025-06-26T10:30:59.565Z","avatar_url":"https://github.com/bdadam.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# metadata-crawler\n\nThis is a simple node.js module for scraping meta information from web pages.\n\nAt the moment this module supports:\n* the `\u003ctitle\u003e` tag in the document head\n* meta[name=\"description\"] tag\n* link[rel=\"canonical\"] tag\n* img elements on the page\n* many [Open Graph](http://ogp.me/) tags (such as: title, description, url, type, image, video)\n\n\n## Install\n\n```\nnpm install metatag-crawler --save\n```\n\n## Usage\n```\nvar scrape = require('metatag-crawler');\nscrape('https://www.youtube.com/watch?v=jNQXAC9IVRw', function(err, data) {});\n\n// if you do not want the relative URLs to be resolved\nscrape('https://www.youtube.com/watch?v=jNQXAC9IVRw', { resolveUrls: false }, function(err, data) {});    \n```\n\n## Example\n\n```JavaScript\nvar scrape = require('metatag-crawler');\nscrape('https://www.youtube.com/watch?v=jNQXAC9IVRw', function(err, data) {\n    console.log(err); // null\n    console.log(data.meta.title); // Me at the zoo\n    console.log(data.meta.description); // The first video on YouTube. Maybe it's time to go back to the zoo?\n    console.log(data.meta.canonical); // https://www.youtube.com/watch?v=jNQXAC9IVRw\n\n    console.log(data);\n    /*\n    {\n        \"meta\": {\n            \"title\": \"Me at the zoo - YouTube\",\n            \"description\": \"The first video on YouTube. Maybe it's time to go back to the zoo?\",\n            \"canonical\": \"https://www.youtube.com/watch?v=jNQXAC9IVRw\"\n        },\n        \"images\": [\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\"\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 48,\n                \"height\": 48\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            },\n            {\n                \"url\": \"https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif\",\n                \"width\": 120,\n                \"height\": 90\n            }\n        ],\n        \"og\": {\n            \"title\": \"Me at the zoo\",\n            \"description\": \"The first video on YouTube. Maybe it's time to go back to the zoo?\",\n            \"url\": \"https://www.youtube.com/watch?v=jNQXAC9IVRw\",\n            \"site_name\": \"YouTube\",\n            \"type\": \"video\",\n            \"images\": [\n                {\n                    \"url\": \"https://i.ytimg.com/vi/jNQXAC9IVRw/hqdefault.jpg\"\n                }\n            ],\n            \"videos\": [\n                {\n                    \"url\": \"https://www.youtube.com/embed/jNQXAC9IVRw\",\n                    \"secure_url\": \"https://www.youtube.com/embed/jNQXAC9IVRw\",\n                    \"type\": \"text/html\",\n                    \"width\": 480,\n                    \"height\": 360\n                },\n                {\n                    \"url\": \"http://www.youtube.com/v/jNQXAC9IVRw?version=3\u0026autohide=1\",\n                    \"secure_url\": \"https://www.youtube.com/v/jNQXAC9IVRw?version=3\u0026autohide=1\",\n                    \"type\": \"application/x-shockwave-flash\",\n                    \"width\": 480,\n                    \"height\": 360\n                }\n            ]\n        }\n    }\n    */\n});\n```\n\n## Changes in version 2.x\n\nIn version 2 the module does not automatically merge properties from different meta information sources.\nEarlier we used to the the following: `title = opengpraph.title || meta.title` and so on with description and canonical url.\n\nThis is no longer the case, we provide all information available on the page. If you need the old behavior, please process the result like this:\n```JavaScript\nscrape('https://www.youtube.com/watch?v=jNQXAC9IVRw', function(err, data) {\n    var oldStyleData = {\n        title: data.og.title || data.meta.title,\n        description: data.og.descriptions || data.meta.description,\n        images: og.images,\n        videos: og.videos\n    };\n\n    // ... do what you used to do before with the oldStyleData\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdadam%2Fmetatag-crawler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdadam%2Fmetatag-crawler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdadam%2Fmetatag-crawler/lists"}