# Quickstart

Go from an API key to a movie detail response and an ending explanation. Sign in, subscribe to Free on the [pricing page](/pricing), and copy your key from [My Subscriptions](/subscriptions). You also need a terminal with cURL. The commands below are for a POSIX shell.

## 1. Configure your connection

Replace `YOUR_API_KEY` with your issued key in your local environment. Keep real keys out of source control and shared command history.

```sh
export ATM_API_BASE_URL="https://whatsafterthemovie-main-0565fcb.zuplo.app/v1"
export ATM_API_KEY="YOUR_API_KEY"
```

See [Authentication](/authentication) for server and mobile integration guidance.

## 2. Find a movie

Search by title, or match an existing IMDb or TMDB identifier. This example looks up _Inception_ by IMDb ID:

```sh
curl --get "$ATM_API_BASE_URL/movies" \
  --header "Authorization: Bearer $ATM_API_KEY" \
  --data-urlencode 'imdb_id=tt1375666' \
  --data-urlencode 'limit=5'
```

The response contains a `data` array and a `pagination` object. An empty array means no catalog record matched. Take the `id` or `slug` of the matching record and set it below:

```sh
export ATM_MOVIE_ID="REPLACE_WITH_RETURNED_ID_OR_SLUG"
```

External IDs are search parameters; movie detail paths use the API's own ID or slug.

## 3. Get movie details

```sh
curl "$ATM_API_BASE_URL/movies/$ATM_MOVIE_ID" \
  --header "Authorization: Bearer $ATM_API_KEY"
```

Read the movie from `data`. Cast, directors, ratings, and links are included in this response. Its `available_content` array tells you which explanation sections can be requested.

## 4. Request a content section

If `available_content` contains `ending`, request the ending explanation:

```sh
curl "$ATM_API_BASE_URL/movies/$ATM_MOVIE_ID/content/ending" \
  --header "Authorization: Bearer $ATM_API_KEY"
```

The result contains `data.movie_id`, `data.type`, `data.text`, and `data.format`. The text is Markdown. Ending explanations contain spoilers; offer an explicit reveal action in your interface.

An existing movie without this section returns `404` with `error.code` set to `content_not_available`. This is an availability result, not a reason to keep retrying.

## Where to go next

- [Search and filters](/movie-search): find films by release year, genre, people, and content availability.
- [Movie content](/movie-content): choose among nine sections and handle their response shapes.
- [Code examples](/examples): use JavaScript or Python from your server.
- [Errors and limits](/errors-and-limits): handle failed requests and rate limits.
