# Search

## Search Movie

## Search Movie.

<mark style="color:blue;">`GET`</mark> `https://api.phantommovies.com/3/search/movie`

Search for a movie.

#### Query Parameters

| Name                                          | Type   | Description                      |
| --------------------------------------------- | ------ | -------------------------------- |
| accessToken<mark style="color:red;">\*</mark> | String | Your API Key                     |
| title<mark style="color:red;">\*</mark>       | String | Movie `title` being searched for |
| year                                          | String | Movie `release year`             |

{% tabs %}
{% tab title="200 Movie Found" %}

```javascript
{
    title: "Avatar: The Way Of Water",
    cover: "https://www.themoviedb.org/t/p/original/t6HIqrRAclMCA60NsSmeqe9RmNV.jpg",
    banner: "https://www.themoviedb.org/t/p/original/198vrF8k7mfQ4FjDJsBmdQcaiyq.jpg",
    trailer: "https://www.youtube.com/watch?v=o5F8MOz_IDw",
    description: "Set more than a decade after the events of the first film, learn the story of the Sully family (Jake, Neytiri, and their kids), the trouble that follows them, the lengths they go to keep each other safe, the battles they fight to stay alive, and the tragedies they endure.",
    rating: "PG-13",
    releaseYear: "2022",
    length: "3h 12m",
    primegenre: "Sci-Fi",
    genres: {
        genre: [
            "Action",
            "Adventure",
            "Sci-Fi"
        ]
    },
    statistics: {
        views: 160,
        votes: 0
    },
    stream: "https://dood.re/e/t1trpkm17b7yxfa4gwsh3l99vt7kl521",
    url: "https://ologyyvidss.com/movies/Avatar:%20The%20Way%20Of%20Water"
}
```

{% endtab %}

{% tab title="401 Permission denied" %}

```javascript
{
    status: "nothing_found",
    message: "No movies found."
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Curl" %}

```javascript
curl -X GET "https://api.phantommovies.com/3/search/movie?title=YOUR_TITLE_HERE" -H "Authorization: Bearer YourAPIKey"
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const axios = require('axios');

axios.get('https://api.phantommovies.com/3/search/movie?accessToken=YourAPIKey&title=Dune')
  .then(response => {
    // Handle the response data
    const movies = response.data;
    console.log('Movies:', movies);
  })
  .catch(error => {
    // Handle the error
    console.error('Error:', error.message);
  });
```

{% endtab %}
{% endtabs %}

### SDK Usage

Search Movie using our official library, `node`:

{% tabs %}
{% tab title="searchMovie()" %}

```javascript
API.searchMovie("title").then((res) => {
	console.log(res);
});
```

{% endtab %}
{% endtabs %}
