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.

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 every 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. With a small set of entities, you can easily debug these errors and warnings.

  2. Validate the sample feed.

    We provide a tool that ensures your feed is compliant with the specifications. We recommend you use the tool to resolve all the errors and warnings of your sample feed.

  3. Create a production feed.

    When you're certain 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 three to five entities from your catalog. (If available, include all the different entity types in your catalog.)
  2. Create a sample feed that contains the selected entities.
  3. Use the Data Feed Validation tool to detect 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_favortie_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/IOSPlatform",
            "http://schema.googleapis.com/GoogleVideoCast"
          ]
        },
        "actionAccessibilityRequirement": {
          "@type": "ActionAccessSpecification",
          "category": "subscription",
          "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

Follow these steps:

  1. Open the Data Feed Validation tool.
  2. Select the Validate on drop-down to Watch Action or Listen Action.
  3. Paste your feed onto the left window of the tool.
  4. Click the following button between the windows.

  5. Correct all the errors and warnings displayed on the right window of the tool.

To learn how to resolve common errors and warnings, see the Troubleshoot using the Data Feed Validation tool section.

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.