{"id":19324898,"url":"https://github.com/spatie/twitter-oembed","last_synced_at":"2025-04-22T20:30:46.899Z","repository":{"id":57056548,"uuid":"385216543","full_name":"spatie/twitter-oembed","owner":"spatie","description":"Retrieve tweets with the Twitter oEmbed API","archived":false,"fork":false,"pushed_at":"2022-03-21T14:43:13.000Z","size":22,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-17T16:14:59.691Z","etag":null,"topics":["api","embd","php","twitter"],"latest_commit_sha":null,"homepage":"https://spatie.be/open-source","language":"PHP","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/spatie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"spatie"}},"created_at":"2021-07-12T10:59:27.000Z","updated_at":"2024-12-14T04:50:58.000Z","dependencies_parsed_at":"2022-08-24T07:30:26.578Z","dependency_job_id":null,"html_url":"https://github.com/spatie/twitter-oembed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"spatie/package-skeleton-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Ftwitter-oembed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Ftwitter-oembed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Ftwitter-oembed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Ftwitter-oembed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spatie","download_url":"https://codeload.github.com/spatie/twitter-oembed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250318585,"owners_count":21410959,"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":["api","embd","php","twitter"],"created_at":"2024-11-10T02:07:25.799Z","updated_at":"2025-04-22T20:30:46.613Z","avatar_url":"https://github.com/spatie.png","language":"PHP","funding_links":["https://github.com/sponsors/spatie"],"categories":[],"sub_categories":[],"readme":"\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/support-ukraine.svg?t=1\" /\u003e](https://supportukrainenow.org)\n\n# Retrieve tweets with the Twitter oEmbed API\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/twitter-oembed.svg?style=flat-square)](https://packagist.org/packages/spatie/twitter-oembed)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/spatie/twitter-oembed/run-tests?label=tests)](https://github.com/spatie/twitter-oembed/actions?query=workflow%3ATests+branch%3Amaster)\n[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/spatie/twitter-oembed/Check%20\u0026%20fix%20styling?label=code%20style)](https://github.com/spatie/twitter-oembed/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amaster)\n[![Total Downloads](https://img.shields.io/packagist/dt/spatie/twitter-oembed.svg?style=flat-square)](https://packagist.org/packages/spatie/twitter-oembed)\n\nA utility package to retrieve tweets with Twitter's [oEmbed API](https://developer.twitter.com/en/docs/twitter-for-websites/oembed-api). The main benefit of Twitter's oEmbed API is that it's public. You don't need to set up a developer account to get started, but the data in the response is minimal.\n\nThis package is meant to set the stage for tools that embed Tweets. For example, a markdown plugin that embeds tweets as static HTML so your blog doesn't need a bloated JavaScript widget. Or a rich text editor plugin for your email platform so tweets can be embedded in newsletters, like Substack does.\n\nIt's still in an experimental stage, I'm not sure what direction this is going to go yet. I don't think it's valuable enough as long as it doesn't support displaying basic data like an image or quoted tweet, which the oEmbed API doesn't return by default.\n\n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/twitter-oembed.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/twitter-oembed)\n\nWe invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).\n\nWe highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require spatie/twitter-oembed\n```\n\n## Usage\n\n```php\n$tweet = (new TwitterOEmbed())-\u003eembed(\n    'https://twitter.com/AoDespair/status/1173718972103090177'\n);\n\necho $tweet-\u003eurl;\n// \"https://twitter.com/AoDespair/status/1173718972103090177\"\n\necho $tweet-\u003ename;\n// \"David Simon\"\n\necho $tweet-\u003eusername;\n// \"@AoDespair\"\n\necho $tweet-\u003ehtml;\n// \"\u003cp\u003eHave I seen The Wire?\u003c/p\u003e\"\n\necho $tweet-\u003edate;\n// 2019-09-16\n```\n\n## Alternatives\n\n- **[j7mbo/twitter-api-php](https://github.com/J7mbo/twitter-api-php):** A Twitter API wrapper. This returns a lot more data, but requires a developer account.\n- **[embed/embed](https://github.com/oscarotero/Embed):** A generic oEmbed package. This supports retrieving oEmbed data from any source, like YouTube or Wikipedia. `spatie/twitter-oembed` aims to add Twitter specific features like parsing the tweet's date and author metadata.\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Sebastian De Deyne](https://github.com/sebastiandedeyne)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Ftwitter-oembed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspatie%2Ftwitter-oembed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Ftwitter-oembed/lists"}