Schema.Org Actions Implementations
... a random collection of screenshots/snippets of actions in practice.
Since it was announced earlier this year, I get often asked how and where schema.org/Actions are used in practice: what real life products it enables.
I was preparing a presentation for a talk to a local workshop, and I was asked for that exact same content, so I figure I'd just copy-paste it here and update it as I find more (most of the content is linked from here).
A caveat: some products launched before the final specification went out (i.e. the official documentation still contains older markup), so I updated the code snippets to the current state (for consistency).
So, here it goes (in no particular order).
Google Search Sitelinks Search Box
Official docs: https://developers.google.com/structured-data/slsb-overview
Here Is What You Write:
<Script Type="Application/Ld+Json">
{
"@Context": "Http://Schema.Org",
"@Type": "WebSite",
"Url": "Https://Www.Example-Petstore.Com/",
"PotentialAction": {
"@Type": "SearchAction",
"Target": "Https://Host.Example-Petstore.Com/Search?Q={Search_term}",
"Query-Input": "Required Name=Search_term"
}
}
</Script>
This Is What You Get:
Google Knowledge Graph
Here is what you write:
http://insidesearch.blogspot.com/2014/06/find-music-on-google-and-start-playing.html http://blog.sgo.to/2014/09/listen-action-in-practice.html
<div itemscope itemtype="http://schema.org/MusicGroup">
<meta itemprop="description" content="Lady Gaga, an artist on Spotify">
<meta itemprop="url"
content="http://open.spotify.com/artist/1HY2Jd0NmPuamShAr6KMms" />
<div itemprop="potentialAction" itemscope
itemtype="http://schema.org/ListenAction">
<meta itemprop="target"
content="http://open.spotify.com/artist/1HY2Jd0NmPuamShAr6KMms" />
</div>
</div>
And this is what you get:
Maps
Here is what you write:
https://developers.google.com/search/docs/data-types/local-businesses
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Restaurant",
"@id": "http://davescafe.example.com/",
"name": "Dave's Cafe",
"image": "http://davescafe.example.com/image.jpg",
"address" :{
"@type": "PostalAddress",
"streetAddress": "123 William St",
"addressLocality": "New York",
"addressRegion": "NY",
"postalCode": "10038",
"addressCountry": "US"
},
"geo":{
"@type": "GeoCoordinates",
"latitude": 40.709312,
"longitude": -74.007136
},
"telephone": "+19172423826",
"potentialAction": {
"@type": "OrderAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://www.example.com/daves-cafe-new-york",
"inLanguage": "en-US",
"actionPlatform": [
"http://schema.org/DesktopWebPlatform",
"http://schema.org/IOSPlatform",
"http://schema.org/AndroidPlatform"
]
},
"deliveryMethod": [
"http://purl.org/goodrelations/v1#DeliveryModePickUp",
"http://purl.org/goodrelations/v1#DeliveryModeOwnFleet"
],
}
}
</script>
And here is what you get:
Gmail
Here is what you write:
https://developers.google.com/gmail/actions/reference/rsvp-action
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Event",
"name": "Taco Night",
"startDate": "2015-04-18T15:30:00Z",
"endDate": "2015-04-18T16:30:00Z",
"location": {
"@type": "Place",
"address": {
"@type": "PostalAddress",
"name": "Google",
"streetAddress": "24 Willie Mays Plaza",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94107",
"addressCountry": "USA"
}
},
"potentialAction": {
"@type": "RsvpAction",
"target": "http://mysite.com/rsvp?eventId=123"
"attendance-input": "required"
}
}</script>
And here is what you get:
Here is one example of an implementer:
https://github.com/blog/1891-view-issue-pull-request-buttons-for-gmail
Google Search App Indexing
Here Is What You Write For Servers:
Https://Developers.Google.Com/App-Indexing/Webmasters/Server
<Script Type="Application/Ld+Json">
{
"@Context": "Http://Schema.Org",
"@Type": "WebPage",
"@Id": "Http://Example.Com/Gizmos",
"PotentialAction": {
"@Type": "ViewAction",
"Target": "Android-App://Com.Example.Android/Http/Example.Com/Gizmos"
}
}
</Script>
And What You'd Write For Native Android Clients:
Https://Developers.Google.Com/App-Indexing/Webmasters/Appindexingapi Https://Developer.Android.Com/Reference/Com/Google/Android/Gms/Appindexing/Action.Html
// Define A Title For Your Current Page, Shown In Autocompletion UI
Final String Title = "App Indexing API Title";
// Call The App Indexing API View Method
AppIndex.AppIndexApi.View(MClient, This, APP_URI, TITLE, WEB_URL, Null);
And This Is What You Get:
(Link To Original Image)
Google Search Social App Activities
Here Is What You Write:
Https://Developers.Google.Com/+/Api/Moment-Types/Listen-Activity
<Script Type="Application/Ld+Json">
{
"Type": "Http://Schema.Org/ListenAction",
"Object": {
"@Type": "MusicRecording",
"Url": "Https://Developers.Google.Com/+/Web/Snippet/Examples/Song",
"Name": "When Johnny Comes Marching Home",
}
}
</Script>
And This What You Get:
Yandex Islands
This what you write:
https://help.yandex.com/webmaster/interactive-answers/buttons-description.xml https://github.com/bobuk/islands/blob/master/interactive-answers-eng.md
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "CheckInAction",
"object": {
"@type": "Flight"
},
"target" : "http://www.example.com/check_in"
}
</script>
And here is what you get:
Microsoft's App Linking
Here is what you write:
http://msdn.microsoft.com/en-us/library/dn614166.aspx
<span itemscope itemtype="http://schema.org/WebPage">
<span itemprop="potentialAction" itemscope
itemtype="http://schema.org/ViewAction">
<span itemprop="target" itemscope
itemtype="http://schema.org/WindowsActionHandler">
</span>
<span itemprop="target" itemscope
itemtype="http://schema.org/WindowsPhoneActionHandler">
</span>
</span>
</span>
And this is what you get:
What's Next?
Holograms :) JK :) But I promise it will be exciting, stay tuned!
In the meantime, you might want to read what I'm up to (and my quest to make APIs suck less) if you are bored and care about the geeky details :)
I'll try to keep this page updated as I find more usages. If you know of cool ways your company/partners/webmasters are using http://schema.org/Action, drop me a line in the comments below and I'll make sure to add them here!