Jump to content

query production year in Search API


akacharos

Recommended Posts

akacharos

Hi,

I am writting a python script to create collections from lists. Everything is working fine, but the problem is that Emby is too loose on the search query and returns results even if the movie title is not exact. Currently the Emby query is like this:

# Find the movies from the list that are available on Emby server
print("###### Searching media availability on Emby server ######")
movies = []
for movie_title in movie_titles:
    headers = {'X-Emby-Token': api_key}
    response = requests.get(f'{url}/Search/Hints', params={'searchTerm': movie_title, 'IncludeItemTypes': 'Movie'}, headers=headers)
    if response.status_code != 200:
        raise Exception('Failed to search for movie')
    search_results = response.json()['SearchHints']
    for result in search_results:
        if result['Type'] == 'Movie':
            movies.append(result['ItemId'])

Is there a way to query the searchterm along with the movie year for better accuracy?

 
Link to comment
Share on other sites

HI, the search hints api is deprecated at this point. Instead you can just use the normal querying api along with the SearchTerm param.

Then you can use the Years filter param.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...