pysurfline.api.services.ApiService

class pysurfline.api.services.ApiService(client, endpoint: str)

Bases: object

Class for Surfline V2 REST API resources.

Parameters
  • client (SurflineAPIClient) – Surfline API client

  • endpoint (str) – API endpoint of service

client

Surfline API client

Type

SurflineAPIClient

endpoint

API endpoint

Type

str

response

response object

Type

requests.Response

Methods

__init__(client, endpoint)

get([params])

get response from request.

Attributes

response

get(params=None) ApiResponseObject

get response from request. Handles HTTP errors and connection errors.

Parameters

params (dict) – request parameters

Returns

response object

Return type

APIResponse

Raises
  • requests.exceptions.HTTPError – if HTTP error occurs

  • requests.exceptions.ConnectionError – if connection error occurs

  • requests.exceptions.RequestException – if other error occurs