code: def get_info(photo_id, api_key):
      ''' Get photo informations from flickr api. '''
      query = urlencode({
          'method': 'flickr.photos.getInfo',
          'api_key': api_key,
          'photo_id': photo_id,
          'format': 'json',
          'nojsoncallback': '1'
      })
  
      r = urlopen('https://api.flickr.com/services/rest/?' + query)
      info = json.loads(r.read().decode('utf-8'))
  
      if info['stat'] == 'fail':
          raise ValueError(info['message'])
  
      return inff get_info(photo_id, api_key):
      ''' Get photo informations from flickr api. '''
      query = urlencode({
          'method': 'flickr.photos.getInfo',
          'api_key': api_key,
          'photo_id': photo_id,
          'format': 'json',
          'nojsoncallback': '1'
      })
  
      r = urlopen('https://api.flickr.com/services/rest/?' + query)
      info = json.loads(r.read().decode('utf-8'))
  
      if info['stat'] == 'fail':
          raise ValueError(info['message'])
  
      return info
docs: Get photo informations from flickr api.