Skip to content
HAT client library for Scala with Play framework
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Scala API wrappers for the HAT

Current Version: 2.6.6-SNAPSHOT

This repository provides convenience wrappers around HAT HTTP APIs and contains the most up-to-date set of typesafe HAT Data Models and Play-JSON based serializers and deserializers for them.

It relies on Play-WS for an asynchronous HTTP client.


The library artifacts are hosted on AWS S3:

resolvers += "HAT Library Artifacts Releases" at ""
// Or for SNAPSHOTS:
// "HAT Library Artifacts Snapshots" at ""
libraryDependencies ++= "org.hatdex" %% "hat-client-scala-play" % 2.6.5

To use the client, it is sufficient to create a new one with minimal configuration:

new HatClient(wsClient, hatAddress, schema)


  • wsClient is an instance of the WS Client, ideally dependency-injected in most cases - check Play documentation for details
  • hatAddress is the fully-qualified domain name of the HAT (e.g.
  • schema is the schema of the address, can either be "http://" (only for development environments) or "https://" (the default if you omit the parameter)

The client is non-blocking and is built around standard Scala Futures. For example, to authenticate with a HAT and request data from it you would then run:

val hat = new HatClient(wsClient, hatAddress, schema)
for {
  accessToken <- hat.authenticateForToken(dataShopperUsername, dataShopperPassword)
  values <- hat.dataDebitValues(dataDebitId)
} yield values
You can’t perform that action at this time.