Skip to content
Docs
GraphQL
Example Queries

This page describes how you can use the GraphQL explorer to query users. More about queries: GraphQL documentation (opens in a new tab)

Get Primary title and Type

To query the type and the primary text title for id tt15398776, the query would include the following:

{
  title(id: "tt15398776") {
    id
    type
    primary_title
  }
}

The response returns primary title Oppenheimer with the type is movie.

Get Plot Text, Genres and IMDB Rating

To query a request for the plot text, genres, and IMDB ratings details for Finding Nemo (2003):

{
  title(id: "tt0266543") {
    id
    type
    start_year
    plot
    genres
    rating{
      aggregate_rating
      votes_count
    }
  }
}

The response returns the plot text, a list of genres and imdb rating with aggregate rating of 8.2 base on 1,098,115 unique user ratings.

Get Credits

To query The Dark Knight (2008) credits:

{
  title(id: "tt0468569") {
    id
    primary_title
    # Get the first two credits for The Dark Knight.
    credits(first: 2) {
      name {
        id
        display_name
        avatars {
          url
          width
          height
        }
      }
       # Get the category for that credit.
      category
    }
  }
}

The response returns the first two credits listed along with the name (Christian Bale and Christopher Nolan) and the category (actor and director).

Multiple categories of credits

To query directors, writers and cast for Spider-Man: No Way Home (2021):

{
  title(id: "tt10872600") {
    id
    primary_title
 
    # Get the first 5 directors
    directors: credits(first: 5, categories:[ "director" ]) {
      name {
        id
        display_name
        avatars {
          url
          width
          height
        }
      }
    }
 
    # Get the first 5 directors
    writers: credits(first: 5, categories:[ "writer" ]) {
      name {
        id
        display_name
        avatars {
          url
          width
          height
        }
      }
    }
 
    # Get the first 5 casts
    casts: credits(first: 5, categories:[ "actor", "actress" ]) {
      name {
        id
        display_name
        avatars {
          url
          width
          height
        }
      }
      characters
    }
  }
}

You can't directly query for the same field with different arguments. That's why you need aliases - they let you rename the result of a field to anything you want.

Content Rating Certificates

To query list of content rating certifications for Inception (2010)

{
  title(id: "tt1375666") {
    id
    certificates{
      country{
        code
        name
      }
      rating
    }
  }
}

The response return 'PG-13' rating in the 'US' region (by the MPA).

Spoken languages and origin countries

{
  title(id: "tt1375666") {
    id
    spoken_languages {
      code
      name
    }
    origin_countries {
      code
      name
    }
  }
}