Example SearchAction-139

JSON-LD (source lint)

<script type="application/ld+json">
  // John searched for 'What is the answer to life the universe and everything?'.
{
  "@context": "http://schema.org",
  "@type": "SearchAction",
  "agent": {
    "@type": "Person",
    "name": "John"
  },
  "query": "What is the answer to life the universe and everything?"
}
</script>

Example SearchAction-140

JSON-LD (source lint)

<script type="application/ld+json">
  // John searched for hotels.
{
  "@context": "http://schema.org",
  "@type": "SearchAction",
  "agent": {
    "@type": "Person",
    "name": "John"
  },
  "query": {
    "@type": "Class",
    "name": "http://schema.org/Hotel"
  }
}
</script>

Example website-1

RDFa (source lint)

<div vocab="http://schema.org/" typeof="WebSite">
    <meta property="url" href="http://www.example.com/"/>
    <form property="potentialAction" typeof="http://schema.org/SearchAction">
      <meta property="target" content="http://www.example.com/search?q={query}"/>
      <input property="query-input" type="text" name="query">
      <input type="submit">
    </form>
</div>

microdata (source lint)

<div itemscope itemtype="http://schema.org/WebSite">
    <link itemprop="url" href="http://www.example.com/"/>
    <form itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction">
	  <meta itemprop="target" content="http://example.com/search?q={query}"/>
      <input itemprop="query-input" type="text" name="query"/>
      <input type="submit"/>
    </form>
</div>

JSON-LD (source lint)

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "WebSite",
    "url": "http://example.com/",
    "potentialAction": {
      "@type": "SearchAction",
      "target": "http://example.com/search?&q={query}",
      "query-input": "required"
    }
}
</script>