{"id":13492579,"url":"https://github.com/extractus/oembed-extractor","last_synced_at":"2026-03-05T07:00:55.851Z","repository":{"id":38361866,"uuid":"94306514","full_name":"extractus/oembed-extractor","owner":"extractus","description":"Extract oEmbed data from given webpage","archived":false,"fork":false,"pushed_at":"2025-09-04T09:34:24.000Z","size":839,"stargazers_count":122,"open_issues_count":0,"forks_count":47,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-23T05:12:09.541Z","etag":null,"topics":["nodejs","oembed-extraction","oembed-extractor"],"latest_commit_sha":null,"homepage":"https://extractus.pwshub.com/oembed","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/extractus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-06-14T08:13:27.000Z","updated_at":"2025-11-22T10:37:35.000Z","dependencies_parsed_at":"2024-05-07T11:43:02.467Z","dependency_job_id":"4af70dbe-d21d-4a13-9036-acc6085a15a4","html_url":"https://github.com/extractus/oembed-extractor","commit_stats":{"total_commits":220,"total_committers":27,"mean_commits":8.148148148148149,"dds":"0.21818181818181814","last_synced_commit":"e3b9aff4084118e12b6e98bdf997a78901ea6dfd"},"previous_names":["ndaidong/oembed-parser"],"tags_count":57,"template":false,"template_full_name":null,"purl":"pkg:github/extractus/oembed-extractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extractus%2Foembed-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extractus%2Foembed-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extractus%2Foembed-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extractus%2Foembed-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extractus","download_url":"https://codeload.github.com/extractus/oembed-extractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extractus%2Foembed-extractor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30113105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["nodejs","oembed-extraction","oembed-extractor"],"created_at":"2024-07-31T19:01:07.251Z","updated_at":"2026-03-05T07:00:55.799Z","avatar_url":"https://github.com/extractus.png","language":"JavaScript","funding_links":["https://paypal.me/ndaidong"],"categories":["JavaScript"],"sub_categories":[],"readme":"\n# oembed-extractor\n\nExtract oEmbed content from given URL.\n\n[![NPM](https://badge.fury.io/js/@extractus%2Foembed-extractor.svg)](https://badge.fury.io/js/@extractus%2Foembed-extractor)\n![CodeQL](https://github.com/extractus/oembed-extractor/workflows/CodeQL/badge.svg)\n[![CI test](https://github.com/extractus/oembed-extractor/workflows/ci-test/badge.svg)](https://github.com/extractus/oembed-extractor/actions)\n\n## Demo\n\n- [Give it a try!](https://extractus-demo.vercel.app/oembed)\n\n## Install \u0026 Usage\n\n### Node.js\n\n```bash\nnpm i @extractus/oembed-extractor\n\n# pnpm\npnpm i @extractus/oembed-extractor\n\n# yarn\nyarn add @extractus/oembed-extractor\n```\n\n```ts\nimport { extract } from '@extractus/oembed-extractor'\n\nconst result = await extract('https://www.youtube.com/watch?v=x2bqscVkGxk')\nconsole.log(result)\n```\n\n### Deno\n\n```ts\nimport { extract } from 'npm:@extractus/oembed-extractor'\n```\n\n### Browser\n\n```ts\nimport { extract } from \"https://esm.sh/@extractus/oembed-extractor@latest\"\n```\n\n## APIs\n\n### `.extract()`\n\nLoad and extract oembed data.\n\n#### Syntax\n\n```ts\nextract(String url)\nextract(String url, Object params)\nextract(String url, Object params, Object fetchOptions)\n```\n\n#### Parameters\n\n##### `url` *required*\n\nURL of a valid oEmbed resource, e.g. `https://www.youtube.com/watch?v=x2bqscVkGxk`\n\n##### `params` *optional*\n\nOptional argument `params` can be useful when you want to specify some additional customizations.\n\nHere are several popular params:\n\n- `maxwidth`: max width of embed size\n- `maxheight`: max height of embed size\n- `theme`: e.g, `dark` or `light`\n- `lang`: e.g, 'en', 'fr', 'cn', 'vi', etc\n\nNote that some params are supported by these providers but not by the others.\nPlease see the provider's oEmbed API docs carefully for exact information.\n\n##### `fetchOptions` *optional*\n\n`fetchOptions` is an object that can have the following properties:\n\n- `headers`: to set request headers\n- `proxy`: another endpoint to forward the request to\n- `agent`: a HTTP proxy agent\n- `signal`: AbortController signal or AbortSignal timeout to terminate the request\n\nYou can use this param to set request headers to fetch.\n\nFor example:\n\n```js\nimport { extract } from '@extractus/oembed-extractor'\n\nconst url = 'https://codepen.io/ndaidong/pen/LYmLKBw'\nextract(url, null, {\n  headers: {\n    'user-agent': 'Opera/9.60 (Windows NT 6.0; U; en) Presto/2.1.1'\n  }\n})\n```\n\nYou can also specify a proxy endpoint to load remote content, instead of fetching directly.\n\nFor example:\n\n```js\nimport { extract } from '@extractus/oembed-extractor'\n\nconst url = 'https://codepen.io/ndaidong/pen/LYmLKBw'\nextract(url, null, {\n  headers: {\n    'user-agent': 'Opera/9.60 (Windows NT 6.0; U; en) Presto/2.1.1'\n  },\n  proxy: {\n    target: 'https://your-secret-proxy.io/loadJson?url=',\n    headers: {\n      'Proxy-Authorization': 'Bearer YWxhZGRpbjpvcGVuc2VzYW1l...'\n    }\n  }\n})\n```\n\nWith the above setting, request will be forwarded to `https://your-secret-proxy.io/loadJson?url={OEMBED_ENDPOINT}`.\n\nAnother way to work with proxy is use `agent` option instead of `proxy` as below:\n\n```js\nimport { extract } from '@extractus/oembed-extractor'\n\nimport { HttpsProxyAgent } from 'https-proxy-agent'\n\nconst proxy = 'http://abc:RaNdoMpasswORd_country-France@proxy.packetstream.io:31113'\n\nconst url = 'https://codepen.io/ndaidong/pen/LYmLKBw'\n\nconst oembed = await extract(url, null, {\n  agent: new HttpsProxyAgent(proxy),\n})\nconsole.log('Run oembed-extractor with proxy:', proxy)\nconsole.log(oembed)\n```\n\nFor more info about [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent), check [its repo](https://github.com/TooTallNate/proxy-agents).\n\nBy default, there is no request timeout. You can use the option `signal` to cancel request at the right time.\n\nThe common way is to use AbortControler:\n\n```js\nconst controller = new AbortController()\n\n// stop after 5 seconds\nsetTimeout(() =\u003e {\n  controller.abort()\n}, 5000)\n\nconst oembed = await extract(url, null, {\n  signal: controller.signal,\n})\n```\n\nA newer solution is AbortSignal's `timeout()` static method:\n\n```js\n// stop after 5 seconds\nconst oembed = await extract(url, null, {\n  signal: AbortSignal.timeout(5000),\n})\n```\n\nFor more info:\n\n- [AbortController constructor](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)\n- [AbortSignal: timeout() static method](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static)\n\n\n### `.setProviderList()`\n\nApply a list of providers to use, overriding the [default](src/utils/providers.orginal.json).\n\n#### Syntax\n\n```ts\nsetProviderList(Array providers)\n```\n\n#### Parameters\n\n##### `providers` *required*\n\nList of providers to apply.\n\nFor example:\n\n```js\nimport { setProviderList } from '@extractus/oembed-extractor'\n\nconst providers = [\n  {\n    provider_name: 'Alpha',\n    provider_url: 'https://alpha.com',\n    endpoints: [\n      // endpoint definition here\n    ]\n  },\n  {\n    provider_name: 'Beta',\n    provider_url: 'https://beta.com',\n    endpoints: [\n      // endpoint definition here\n    ]\n  }\n]\n\nsetProviderList(providers)\n```\n\nDefault list of resource providers is synchronized from [oembed.com](http://oembed.com/providers.json).\n\nIf you want to modify providers list, please make pull request on [iamcal/oembed](https://github.com/iamcal/oembed) then create issue/pr here to ask for sync.\n\n\n## Facebook and Instagram\n\nIn order to work with the links from Facebook and Instagram, you need a [reviewed Facebook's app](https://developers.facebook.com/docs/app-review) with [oEmbed Read](https://developers.facebook.com/docs/features-reference/oembed-read) permission.\n\nWhen seeing a link from Facebook or Instagram, `oembed-parser` will look for environment variables `FACEBOOK_APP_ID` and `FACEBOOK_CLIENT_TOKEN` to retrieve oembed data using your app credentials.\n\nFor example:\n\n```bash\nexport FACEBOOK_APP_ID=your_app_id\nexport FACEBOOK_CLIENT_TOKEN=your_client_token\n\nnpm run eval https://www.instagram.com/tv/CVlR5GFqF68/\n```\n\n\n## Test\n\n```bash\ngit clone https://github.com/extractus/oembed-extractor.git\ncd oembed-extractor\nnpm i\nnpm test\n```\n\n![oembed-extractor unit test](https://i.imgur.com/Nr5BgUx.png)\n\n\n## Quick evaluation\n\n```bash\ngit clone https://github.com/extractus/oembed-extractor.git\ncd oembed-extractor\nnpm i\nnpm run eval {URL_TO_PARSE_OEMBED}\n```\n\n## License\nThe MIT License (MIT)\n\n\n## Support the project\n\nIf you find value from this open source project, you can support in the following ways:\n\n- Give it a star ⭐\n- Buy me a coffee: https://paypal.me/ndaidong 🍵\n- Subscribe [oEmbed Parser service](https://rapidapi.com/pwshub-pwshub-default/api/oembed-parser/) on RapidAPI 😉\n\nThank you.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextractus%2Foembed-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextractus%2Foembed-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextractus%2Foembed-extractor/lists"}