API Reference

Core functions

HAPIClient.hapiFunction

Main interface to HAPI servers and provides multiple dispatch for different use cases:

  • hapi() - List available HAPI servers (get_servers)
  • hapi(server) - Get catalog of datasets from a server (get_catalog)
  • hapi(server, dataset) - Get parameter information for a dataset (get_parameters)
  • hapi(server, dataset, parameters) - Get parameter information for specific parameters (get_parameters)
  • hapi(server, dataset, tmin, tmax) - Get all data for a dataset in a time range (get_data)
  • hapi(server, dataset, parameters, tmin, tmax) - Get specific parameter data in a time range (get_data)
source
HAPIClient.get_dataFunction
get_data(server, dataset, parameters, tmin, tmax; format="csv")

Get data and metadata from a HAPI server for a given dataset and parameters within a time range [tmin, tmax].

Supported optional keyword arguments:

  • format: Data format, default is "csv" (other options: "binary", "json").
  • verbose: Verbosity level (passed to HTTP.get), default is 0 (other options: 1, 2).
source
get_data(path, tmin, tmax; kwargs...)

Get data and metadata using a path in the format "server/dataset/parameter".

source

Types

HAPIClient.HAPIVariableType

An array-like object that represents a HAPI variable.

Fields

  • data: The underlying data values (use parent(x) to access).
  • time: The time axis (use times(x) to access).
  • meta: The metadata (use meta(x) to access).
source
HAPIClient.HAPIVariableMethod
HAPIVariable(data, params, i)

Construct a HAPIVariable object from a JSON-parsed data and params at index i.

source
HAPIClient.HAPIVariableMethod
HAPIVariable(d, i)

Construct a HAPIVariable object from a JSON-parsed Dict d (containing parameters) at index i.

source

Predefined Servers

Convenient constants for commonly used HAPI servers are automatically exported (the valid keys of the SERVERS dictionary, e.g. DAS2, CDAWeb, etc.) and can be used directly:

using HAPIClient
HAPIClient.SERVERS
Dict{String, HAPIClient.Server} with 19 entries:
  "DAS2"            => Server("https://planet.physics.uiowa.edu/das/das2Server/…
  "TESTDATA2.1"     => Server("http://hapi-server.org/servers/TestData2.1/hapi"…
  "TESTDATA3.0"     => Server("http://hapi-server.org/servers/TestData3.0/hapi"…
  "WDC"             => Server("https://wdcapi.bgs.ac.uk/hapi", "WDC", "HAPI WDC…
  "TESTDATA3.3"     => Server("http://hapi-server.org/servers/TestData3.3/hapi"…
  "VIRES-FOR-SWARM" => Server("https://vires.services/hapi", "VirES-for-Swarm",…
  "TESTDATA3.2"     => Server("http://hapi-server.org/servers/TestData3.2/hapi"…
  "AMDA"            => Server("https://amda.irap.omp.eu/service/hapi", "AMDA", …
  "KNMI"            => Server("https://hapi.spaceweather.knmi.nl/hapi", "KNMI",…
  "CSA"             => Server("https://csatools.esac.esa.int/HapiServer/hapi", …
  "HELIOVIEWER"     => Server("https://api.helioviewer.org/hapi/Helioviewer/hap…
  "SUPERMAG"        => Server("https://supermag.jhuapl.edu/hapi", "SuperMAG", "…
  "CDAWEB"          => Server("https://cdaweb.gsfc.nasa.gov/hapi", "CDAWeb", "C…
  "CCMC_ISWA"       => Server("https://iswa.gsfc.nasa.gov/IswaSystemWebApp/hapi…
  "INTERMAGNET"     => Server("https://imag-data.bgs.ac.uk/GIN_V1/hapi", "INTER…
  "TESTDATA3.1"     => Server("http://hapi-server.org/servers/TestData3.1/hapi"…
  "LISIRD"          => Server("http://lasp.colorado.edu/lisird/hapi", "LISIRD",…
  "SSCWEB"          => Server("http://hapi-server.org/servers/SSCWeb/hapi", "SS…
  "TESTDATA2.0"     => Server("http://hapi-server.org/servers/TestData2.0/hapi"…

Public

HAPIClient.get_dataMethod
get_data(server, dataset, parameters, tmin, tmax; format="csv")

Get data and metadata from a HAPI server for a given dataset and parameters within a time range [tmin, tmax].

Supported optional keyword arguments:

  • format: Data format, default is "csv" (other options: "binary", "json").
  • verbose: Verbosity level (passed to HTTP.get), default is 0 (other options: 1, 2).
source
HAPIClient.get_dataMethod
get_data(path, tmin, tmax; kwargs...)

Get data and metadata using a path in the format "server/dataset/parameter".

source
HAPIClient.hapiFunction

Main interface to HAPI servers and provides multiple dispatch for different use cases:

  • hapi() - List available HAPI servers (get_servers)
  • hapi(server) - Get catalog of datasets from a server (get_catalog)
  • hapi(server, dataset) - Get parameter information for a dataset (get_parameters)
  • hapi(server, dataset, parameters) - Get parameter information for specific parameters (get_parameters)
  • hapi(server, dataset, tmin, tmax) - Get all data for a dataset in a time range (get_data)
  • hapi(server, dataset, parameters, tmin, tmax) - Get specific parameter data in a time range (get_data)
source

Private

HAPIClient.ParameterType
Parameter

Represents a HAPI parameter with validation according to the specification.

Required fields:

  • name: String identifier for the parameter
  • type: One of "string", "double", "integer", or "isotime"
  • units: String, array of strings, or nothing for dimensionless quantities
  • fill: String or nothing indicating no fill value

Type-specific requirements:

  • For string and isotime types: must specify length
  • For array parameters: must specify size

Optional fields:

  • description: Brief description of the parameter
  • label: Display label or array of labels
  • size: Array dimensions for array parameters
  • bins: Array parameter bin information
  • stringType: For string parameters that represent URIs
  • coordinateSystemName: Name of coordinate system for vector quantities
  • vectorComponents: Component names for vector quantities
source
HAPIClient.get_catalogMethod
get_catalog(server)

Get a list of datasets available from the server.

HAPI info response JSON structure: https://github.com/hapi-server/data-specification/blob/master/hapi-dev/HAPI-data-access-spec-dev.md#35-catalog

source
HAPIClient.get_parametersMethod
get_parameters(server, dataset, parameters)

Get a dictionary containing the HAPI info metadata for each parameter in the comma-separated string parameters.

source
HAPIClient.get_parametersMethod
get_parameters(server, dataset)

Get a dictionary containing the HAPI info metadata for all parameters in the dataset. Returns a tuple of (info, parameters) where info is the full response and parameters is a Vector of Parameter objects.

HAPI info response JSON structure: https://github.com/hapi-server/data-specification/blob/master/hapi-dev/HAPI-data-access-spec-dev.md#36-info

source
HAPIClient.get_serversFunction
get_servers()

Get a list of available HAPI server URLs from https://github.com/hapi-server/servers/raw/master/all.txt

source