Repository navigation
Using oEmbed With Known Providers
Known-provider routing is the fastest path when a resource URL matches one of the library’s active provider patterns. Use the public Wrapper entry point unless you specifically need a historical concrete provider class.
using WillStrohl.API.oEmbed;
var request = new RequestInfo(
"https://open.spotify.com/track/1234567890",
640,
360);
var html = new Wrapper().GetContent(request);RequestInfo(string url, int width, int height) sets MaxWidth and MaxHeight. The default constructor uses -1 for both dimensions, which means no dimension parameter is added when discovery builds a request.
For active provider URLs, Wrapper.GetContent selects the provider and uses its endpoint or provider implementation. For unsupported URLs, it falls through to discovery; see Using unknown providers.
| Provider | Active endpoint or behavior |
|---|---|
| Embedly | Historical provider routing retained by the library |
| Flickr | Photo response handling |
| Hulu | Video response handling |
| oohEmbed | Rich response handling |
| Qik | Video response handling |
| Revision3 | Video response handling |
| SoundCloud |
https://soundcloud.com/oembed, JSON rich responses |
| Spotify |
https://open.spotify.com/oembed, JSON rich responses |
| TikTok |
https://www.tiktok.com/oembed, unauthenticated JSON responses |
| Vimeo | Video response handling |
| YouTube | Video response handling |
Provider availability is controlled by each provider. A URL pattern matching the library does not guarantee that the remote service will respond successfully.
var spotify = new Wrapper().GetContent(
new RequestInfo("https://open.spotify.com/album/1234567890"));
var soundCloud = new Wrapper().GetContent(
new RequestInfo("https://soundcloud.com/artist/track"));
var tikTok = new Wrapper().GetContent(
new RequestInfo("https://www.tiktok.com/@creator/video/1234567890123456789"));These integrations use unauthenticated official oEmbed endpoints. They do not accept application credentials. TikTok embeds may change or become unavailable as TikTok changes its embed lifecycle.
Concrete provider classes remain part of the compatibility surface. For new code, prefer Wrapper.GetContent because it centralizes routing, request handling, response parsing, and HTML safety.
The older explicit methods are still available when an application already owns an endpoint or depends on the historical API:
var wrapper = new Wrapper();
var photoUrl = wrapper.GetPhotoContent(
"https://provider.example/oembed",
new RequestInfo("https://provider.example/photo/123"));Use explicit endpoints only when the provider’s oEmbed contract is known and unauthenticated. The same request security and response handling rules apply.
PollEverywhere, MyOpera, and Viddler remain public types and constants so existing consumers can compile against the library. Their historical URL patterns are intentionally excluded from automatic routing because current endpoint availability is not claimed.
Do not interpret their public availability as a guarantee of live provider support.
-
photo: returns the photo URL through the existing wrapper methods. -
video: returns transformed safe HTML. -
rich: returns transformed safe HTML. -
link: returns the response title when reached through discovery.
Malformed JSON and unsupported response types are rejected rather than rendered as arbitrary HTML.
This innovation is maintained by Upendo Ventures. Demos of this software can be seen on various runsonUpendo client websites.