Create a feed

The Media Actions feed is a JSON object that contains a collection of entities that represent the media content in your catalog: TV shows, movies, songs, albums, and more. You need to provide a feed as a file and host it on a server or a cloud storage service for Google to fetch regularly.

Feed file requirements

The following are the requirements for the feed file:

  • Use the filename extension .json.
  • Don't encrypt your feed file.
  • Encode your feed file in UTF-8 (check your file editor setting).

    alt_text

  • Split the file into multiple files if your feed file is larger than 1 GB (uncompressed).

  • We recommend you create a file per entity type (for example, tvseries.json, tvseasons.json, tvepisodes.json, movies.json, etc).

    • If any of these files exceeds 1GB, split its entities into multiple files (for example, tvepisodes_01.json, tvepisodes_02.json, etc).
    • As long as the file size is less than 1 GB, there is no limitation on how many entities you can include in a single file.
  • Ensure that the file is encoded without BOM, as per JSON specification. To check on a linux OS, hexdump file.json | head -n 1 must not start with BBEF at address 0x00.

Create a feed file

When creating a feed file, follow these best practices:

  1. Create a sample feed using a small set of entities.

    Before building a feed that contains all the content in your catalog, we recommend you create a sample feed with only a small set of entities. While working on your feed, you're likely to run into issues. By limiting your the size of the set of entities, you will be able to debug these errors and warnings more easily.

  2. Validate the sample feed.

    We provide tools that ensure that your feed is compliant with the specifications. We recommend you use these tools to resolve all the errors and warnings found in your sample feed.

  3. Create a production feed.

    After you've verified that you have a good structure for the small set of your entities, develop a feed for your entire catalog.

Create a sample feed

Follow these steps:

  1. Select one representative entity from your catalog. Choose an entity with a reasonably complex structure, but is still typical for an entity in the catalog.
  2. Use the Data Feed Validation tool to check for syntax errors and missing required properties. (See the next section for details.)

Example of a feed with a single Movie entity:

{
  "@context": "http://schema.org",
  "@type": "DataFeed",
  "dateModified": "2018-07-20T00:44:51Z",
  "dataFeedElement": [
    {
      "@context": ["http://schema.org", {"@language": "en"}],
      "@type": "Movie",
      "@id": "http://www.example.com/my_favorite_movie",
      "url": "http://www.example.com/my_favorite_movie",
      "name": "My Favorite Movie",
      "potentialAction": {
        "@type": "WatchAction",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "http://www.example.com/my_favorite_movie?autoplay=true",
          "inLanguage": "en",
          "actionPlatform": [
            "http://schema.org/DesktopWebPlatform",
            "http://schema.org/MobileWebPlatform",
            "http://schema.org/AndroidPlatform",
            "http://schema.org/AndroidTVPlatform",
            "http://schema.org/IOSPlatform",
            "http://schema.googleapis.com/GoogleVideoCast"
          ]
        },
        "actionAccessibilityRequirement": {
          "@type": "ActionAccessSpecification",
          "category": "subscription",
          "requiresSubscription": {
            "@type": "MediaSubscription",
            "name": "Example Package",
            "commonTier": true,
            "@id": "[partner determined string]"
          },
          "availabilityStarts": "2018-07-21T10:35:29Z",
          "availabilityEnds": "2019-10-21T10:35:29Z",
          "eligibleRegion": [
            {
              "@type": "Country",
              "name": "US"
            },
            {
              "@type": "Country",
              "name": "CA"
            }
          ]
        }
      },
      "sameAs": "https://en.wikipedia.org/wiki/my_favorite_movie",
      "releasedEvent": {
        "@type": "PublicationEvent",
        "startDate": "2008-01-20",
        "location": {
          "@type": "Country",
          "name": "US"
        }
      },
      "description": "This is my favorite movie.",
      "actor": [
        {
          "@type": "Person",
          "name": "John Doe",
          "sameAs": "https://en.wikipedia.org/wiki/John_Doe"
        },
        {
          "@type": "Person",
          "name": "Jane Doe",
          "sameAs": "https://en.wikipedia.org/wiki/Jane_Doe"
        }
      ],
      "identifier": [
        {
          "@type": "PropertyValue",
          "propertyID": "IMDB_ID",
          "value":  "tt0123456"
        }
      ]
    }
  ]
}

Validate the sample feed

We provide the following tools to help you validate a sample feed with Google's structured data specifications for media action feeds.

  • Data Feed Validation tool

    The Data Feed Validation tool can validate a single entity at a time. Use this tool to validate a sample entity from your catalog for structural errors and common content errors. Please refer here for more details.

  • JSON Schema Validation tool

    The JSON Schema Validation tool can validate all files in a feed. Use this tool during the development of the feed to avoid common structural errors. Please refer here for more details.

Create a production feed

Follow these steps:

  1. After you resolve all the errors and warnings in your sample feed, expand the feed to include all the entities in your catalog.
  2. Use the Data Feed Validation tool frequently to validate a small number of entities in your feed at a time. (Pasting a large number of entities on the tool may freeze the web browser.)
  3. To confirm that your feed includes all the entities in your catalog, compare the number of entities in your feed with the number of items in your catalog.