### Navigation

- index
- modules |
- next |
- previous |
- python-sunlight 1.1.5 documentation »

# sunlight.service – API superclass

This page is more aimed to API hackers, not so much API users. If you’re a user, feel free to read up on how this works, but this might not be the easiest thing to develop an app around.

## Classes and Variables

Base service class. All API classes (such as say - `sunlight.services.openstates.OpenStates`) inherit from this.

class `sunlight.service.``Service`

  Base class for all the API implementations, as well as a bunch of common code on how to actually fetch text over the network.

  `get`(top_level_object, **kwargs)

    Get some data from the network - this is where we actually fetch something and make a request.

    Warning

    Be sure that API_KEY was set before calling this method. This will throw a `sunlight.errors.NoAPIKeyException` if the API_KEY is not set.

    args:
      `top_level_object` (str): Thing to query for (such as say,
        “bills” for OpenStates )
    kwargs:
      These arguments will be passed to the underlying API implementation to help create a query. Validation will happen down below, and on a per-API level.

### Navigation

- index
- modules |
- next |
- previous |
- python-sunlight 1.1.5 documentation »