Exploring data by entity

Alongside obtaining data by reading feeds, the MK Data Hub provides an interface for reading streams of integrated data that are aggregated from a multitude of datasets registered with the Data Catalogue. The aggregation logic revolves around presenting all the data that the user has access to regarding a specific entity (e.g. a location in Milton Keynes). This way, the user is not required to specify the URL or name of a data source or feed. This document is a guide for developers who do not require to tweak their data-intensive applications to use specific data-sources.

Getting started

    1. Arm yourself with an HTTP client (e.g. curl, your own client code, or even this browser) and you’re good to go.
  • Perform an HTTP GET request to https://data.mksmart.org/entity/ e.g.
  • curl https://data.mksmart.org/entity/ If the response is JSON content of the type then the API is alive and reachable. In order to explore the data published by the API, you need to be able to identify the entity to obtain data about. Identifying an entity essentially means constructing a URI that is submitted to the API. Note that the Entity Lookup Facility provides a way to simply construct requests to the entity-centric API.

    Exploring by type and identifier

    Making requests to the entity-centric API is relatively simple, as long as you know the type and identifier of the entity about which information is required. For example, getting information about the geographic sector “MK77” is simply done by calling the URI: https://data.mksmart.org/entity/sector/MK77 where:
      • sector here is the type of the entity. The Entity Lookup service lists the types that are covered by the API, and the data catalogue provides links to the types datasets provide. It might be postcode, place or topic for example.
  • MK77 here is the identifier of the entity to be retrieved. The format of the identifier is dependent on the type. A postcode for example might rather be MK76AA, a place or a topic are identified by their name (e.g. walton_hall, computer), while a geo-point is identified by its coordinate (e.g. 52.03333_-0.7).
    The following interactive API specification allows you to try out calls to the MK:Smart entity API right before you add them to your development environment. Click on the list items below to see the supported operations and parameters. Powered by Swagger.  

    Response format

    All the services return bespoke, simple JSON, aggregating information from multiple sources. The result of calls such as the ones of the examples above will return a simple JSON object with attributes coming from the original sources.