The Media feed is a JSON object that contains a collection of entities that represent the
media content in your catalog, such as TV Series, Movies, Songs, Albums, and more. The first step in
the onboarding process is to start developing your feeds. Once the files are ready, you need to [host](https://developers.google.com/actions/media/how-to/host-the-feed)
the feed using one of the supported hosting methods for Google to fetch regularly.

> [!NOTE]
> **Note:** If you haven't gathered all the required information for your content, see the [Collect Information](https://developers.google.com/actions/media/collect-information/) section.

## Feed file format requirements

The following are the requirements for the feed file(s):

- Feed file must have the filename extension `.json`.
- Don't encrypt your feed file.
- Encode your feed file in UTF-8 (check your file editor setting).

  ![alt_text](https://developers.google.com/actions/media/images/image-media-actions-1.png "Feed encoding settings")
- 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](https://tools.ietf.org/html/rfc7159#section-8.1). To check on a linux OS, `hexdump file.json | head -n 1` must not start with `BBEF` at address 0x00.

## Types of feeds

### Production feed

- This represents the set of json feed file(s) that together represent your entire catalog you want to launch on Google. You can learn how to create a feed in the section below.
- This is the only feed you need if you are integrating with Google for the first time.
- Once this feed is submitted to Google, it will be extensively analyzed and iterated on a few times to achieve a higher quality bar w.r.t the amount of information being captured and its correctness before it is finally ingested and launched.

### Staging feed

- There are certain use cases that require the expansion of the production feed. A few examples of such scenarios are:
  - Expansion of the feed to include new entity types, not previously launched.
  - Expansion of the feed to include a huge number of new entities/metadata to launch in new locales.
  - Expansion of the feed to new platform types. For example, when the production feed is only launched on Google Search and now you want to expand the launch to Google TV.
- In such cases, a staging feed is required. This feed is a copy of the production feed except that it has additional metadata, for example, deep links for a new platform, metadata for a new locale and so on.
- Similar to the production feed, this will be extensively analyzed and iterated on a few times to achieve a higher quality bar w.r.t the amount of information being captured and its correctness. Once the quality bar is achieved, this feed replaces the current production feed to become the new production feed.
- This feed allows us to separate the initial launch from the additional launches, perform all required testing, without affecting the production feed. This ensures no disruptions to the end user experience.

Work with your Google representative to clarify any questions you may have on the above.

## Create a feed file

Follow these best practices when creating the feed:

1. [Create a sample feed using a small set of entities](https://developers.google.com/actions/media/how-to/create-a-feed#create_a_sample_feed)

   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](https://developers.google.com/actions/media/how-to/create-a-feed#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](https://developers.google.com/actions/media/how-to/create-a-feed#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

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 [JSON Schema Validation tool](https://developers.google.com/actions/media/tools/jsonschemas) 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

The following tools are available to help you validate a sample feed against Google's structured data
specifications for media feeds:

- **JSON Schema Validation tool**

  The JSON Schema Validation tool validates all files in a feed locally before upload. Use this
  tool during the development of the feed to avoid common structural and type errors. You can
  find more details about the tool [here](https://developers.google.com/actions/media/tools/jsonschemas).
- **Catalog Properties on Search Console**

  After your Google representative enables your Search Console catalog property and your sample
  or staging feed is ingested, use [Catalog Properties on Search Console](https://developers.google.com/actions/media/how-to/monitor-the-feed) to
  inspect entity-level validation errors, warnings, and ingestion diagnostics.

### Create a production feed

1. Once all structural errors and warnings in the sample feed are resolved, expand the feed to include all the entities in your catalog.
2. Run the [JSON Schema Validation tool](https://developers.google.com/actions/media/tools/jsonschemas) on your expanded feed files and review [Catalog Properties on Search Console](https://developers.google.com/actions/media/how-to/monitor-the-feed) after upload to verify that there are no validation errors. Confirm that your feed includes all the entities in your catalog by comparing the number of entities in your feed with the number of items in your catalog.