import requests


def get_series_omdb_id( series_name, apikey ):
    """
    Returns the most likely IMDB_ key, using the OMDB_ API, for a TV show.

    :param str series_name: the series name.
    :param str apikey: the OMDB_ API key.
    
    :returns: the IMDB_ key associated with ``series_name``.
    :rtype: str

    .. _OMDB: http://www.omdbapi.com
    .. _TMDB: https://www.themoviedb.org/documentation/api?language=en-US
    """
    params = { 's' : series_name, 'type' : 'series', 'plot' : 'full', 'apikey' : apikey }
    response = requests.get( 'http://www.omdbapi.com', params = params )
    if response.status_code != 200:
        return None
    data = response.json( )
    if 'Search' not in data:
        return None
    if 'totalResults' not in data:
        return None
    if data['totalResults'] == 0:
        return None
    items = list(
        filter(lambda item: 'Poster' in item.keys( ) and item['Poster'] != 'N/A' and 'imdbID' in item.keys( ),
               data['Search']) )
    if len( items ) == 0:
        return None
    return items[0]['imdbID']