Getting Started

The following sections will help you get started using the Movies API. See also the Code Examples section for examples in Python, JavaScript, and PHP.

Endpoint

The Movies API endpoint is https://jh-data.com/moviesapi/.

Authentication

Authentication is accomplished with an API key. To obtain your API key, fill out the Contact form, and include "Requesting API key" in your message.

Important Security Note

Treat your API key like a password! Keep your API key secret and do not share it publicly. Never embed your API key directly in client-side code (like JavaScript in web browsers) as this would expose it. For server-side applications, store your API keys securely as environment variables or use a secrets management system. Always use HTTPS to encrypt API traffic when sending API keys.

Include your API key in the X-API-Key HTTP header with each request, as shown in the following example which uses curl. Replace YOUR_API_KEY with your API key.

curl -X POST \
  'https://jh-data.com/moviesapi/' \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"query": "{ hello }"}'

Basic Examples of Requests and Responses

The following sections provide basic example movies, moviesByTitle, and moviesByGenre queries, and the responses.

movies

REQUEST:

query {
  movies(limit: 5, offset: 0) {
    id
    title
  }
}

RESPONSE:

{
  "data": {
    "movies": [
      {
        "id": "5",
        "title": "Four Rooms"
      },
      {
        "id": "11",
        "title": "Star Wars"
      },
      {
        "id": "12",
        "title": "Finding Nemo"
      },
      {
        "id": "13",
        "title": "Forrest Gump"
      },
      {
        "id": "14",
        "title": "American Beauty"
      }
    ]
  }
}

moviesByTitle

REQUEST:

query {
  moviesByTitle (title: "Forrest Gump") {
    id
    title
    revenue
  }
}

RESPONSE

{
  "data": {
    "moviesByTitle": [
      {
        "id": "13",
        "title": "Forrest Gump",
        "revenue": 677945399
      }
    ]
  }
}

moviesByGenre

REQUEST:

query {
  moviesByGenre(limit: 5, offset: 0, genre: "Action") {
    id
    title
    revenue
    director
  }
}

RESPONSE:

{
  "data": {
    "moviesByGenre": [
      {
        "id": "11",
        "title": "Star Wars",
        "revenue": 775398007,
        "director": "George Lucas"
      },
      {
        "id": "18",
        "title": "The Fifth Element",
        "revenue": 263920180,
        "director": "Luc Besson"
      },
      {
        "id": "22",
        "title": "Pirates of the Caribbean: The Curse of the Black Pearl",
        "revenue": 655011224,
        "director": "Gore Verbinski"
      },
      {
        "id": "24",
        "title": "Kill Bill: Vol. 1",
        "revenue": 180949000,
        "director": "Quentin Tarantino"
      },
      {
        "id": "58",
        "title": "Pirates of the Caribbean: Dead Man's Chest",
        "revenue": 1065659812,
        "director": "Gore Verbinski"
      }
    ]
  }
}