Matchlight Connection Configuration

Base Connection Object

class matchlight.connection.Connection(access_key=None, secret_key=None, https_proxy=None, insecure=False, endpoint=None, search_endpoint=None)[source]

Matchlight API connection object.

request(path, data=None, endpoint=None, **kwargs)[source]

Send an HTTP request to the Matchlight API.

Parameters:
  • path (str) – The path of request URL without the URL base. e.g. /search.
  • data (dict or list) – Serializable data for POST requests. Defaults to None.
  • endpoint (str, optional) – option to pass a different endpoint for each request. Defaults to Connection().endpoint
Returns:

A requests.models.Response object.

Raises:
  • ConnectionError – Raised when there is an RetryError or ConnectionError from requests.
  • APIError – Raised when API does not return a 200, including error and custom message, if available.