Updated on Sep 14, 2023

2

min read

Actor structure

In the Movies API, actor information is organized into a structured format to provide comprehensive details about each actor in the database. Understanding this structure will help you work with actor data effectively.

Actor Object

Each actor in the API is represented as an object with the following properties:

  • id (integer): The unique identifier for the actor.

  • name (string): The full name of the actor.

  • birthdate (string, optional): The birthdate of the actor (if available).

  • nationality (string, optional): The nationality of the actor (if available).

  • biography (string, optional): A brief biography or description of the actor (if available).

  • movies (array of objects): A list of movies associated with the actor. Each movie object includes:

    • id (integer): The unique identifier of the movie.

    • title (string): The title of the movie.

    • release_date (string): The release date of the movie.

    • character (string): The character played by the actor in the movie.

Here's an example of an actor object:

{
  "id": 123,
  "name": "Morgan Freeman",
  "birthdate": "1937-06-01",
  "nationality": "American",
  "biography": "Morgan Freeman is a renowned American actor...",
  "movies": [
    {
      "id": 54321,
      "title": "The Shawshank Redemption",
      "release_date": "1994-09-23",
      "character": "Ellis Boyd 'Red' Redding"
    },
    {
      "id": 98765,
      "title": "Seven",
      "release_date": "1995-09-22",
      "character": "Detective Somerset"
    }
  ]
}

Retrieving Actor Information

You can retrieve actor information by making GET requests to the appropriate API endpoints. For example:

  • To retrieve a specific actor by ID: GET /actors/{actor_id}

  • To search for actors by name or other criteria: GET /actors?q={search_query}

Understanding the structure of actor objects will help you work with actor data efficiently when using the Movies API.