Description of web services provided by the Edinburgh GIN

View the Edinbugh GIN software version and release notes.

Web sites that use the INTERMAGNET web service

These web sites provide a user-friendly, interactive interface to the web services described below.

View INTERMAGNET observatory data: /GIN_V1/GINForms2

View INTERMAGNET data statistics: /GIN_V1/GINStatistics

View test observatory data at the Edinburgh GIN: /GIN_V1/GINTest2

HAPI Web Service

INTERMAGNET provides a HAPI (Heliophysics Application Programmer's Interface) web service: /GIN_V1/hapi

INTERMAGNET Web service

The INTERMAGNET web service allows access to INTERMAGNET data in the form of data files in community formats, interoperable formats (such as JSON) and plot files. Metadata and statistics on data provision and data usage are also available. A full description is given here so that other organisations may easily incorporate these services into their own products. The type of information that the services provide is controlled by parameters that are passed to the service in the URL's query string.

The web service is available from this base URL: /GIN_V1/GINServices. The services support both POST and GET http methods. The 'Request' parameter controls what information will be provided.

Some institutes choose to embargo their data for a short time. Details of the embargo and the ways in which it may be possible to waive the embargo for an observatory's data are described in the section on embargoes.

To help understand how to format URLs to retrieve data from the web service, a URL generation application is available. This application allows you to enter values for the data that you want to retrieve and then to see (and copy) the URL that can be used to retrieve the data.

Request Description
GetCapabilities Get lists of the things that this service is able to provide.
GetData Get geomagnetic data, either in the form of data files, or magnetograms.
GetDataDirectory Get a directory of the available geomagnetic data for a given set of observatories and time window.
GetDataModificationTime Get the date/time at which data for a given set of observatories and time window was last updated.
GetDataLagTime Get a listing of the lag time (the amount of time between the current time and the time of the latest data sample from an observatory). The lag time is sampled hourly for each observatory and recorded to allow operators to see how long their data is taking to reach the GIN.
GetDownloadScript Get a script (or batch file) that can be used to download data. The script makes use of the 'GetData' service to retrieve geomagnetic data.
GetMonthlyDataStatistics Get the statistics files that are sent to observatories each month to describe the amount of data that has been received.
GetUsageStatistics Get the statistics on data downloads from the web and ftp sites.

HTTP status codes

The Intermagnet web services use the following status codes:

HTTP status codeDescription
200The request was completed successfully.
301A resource has been moved. The body of the request describes the new URL for the request.
400Bad request. This is returned where the request parameters are incorrect.
404The requested data is not available.
500The server encountered an error while trying to process the request.

Capabilities service

The capabilities service is designed to allow remote systems to interrogate the GIN and discover its capabilities. The service returns:

The following parameters may be used to control the capabilities request:

Parameter Description Valid values Default value
Request Must be set to GetCapabilities
Format The format that capabilities will be sent in. html; json; xml xml
testObsys Whether to use the GIN's test observatories (set parameter to '1') or production observatories 1; 0 (but see test and production observatories in the embargo section). 0

Use the Web Service URL Generator to see how to create URLs for this service.

Data service

The data service provides geomagnetic data from INTERMAGNET observatories either as data files or as magnetograms. The following parameters may be used to control the data request:

Parameter Description Valid values Default value
Request Must be set to GetData
Format The format that the data will be sent in, including data file and magnetogram formats.
  • Data files: covJson; html; xml; json; iaga2002; imagcdf; imfv122; wdc.
  • Magnetograms: png, jpg, pdf.
xml
testObsys Whether to use the GIN's test observatories (set parameter to '1') or production observatories 1; 0 (but see test and production observatories in the embargo section). 0
observatoryIagaCode Three digit IAGA observatory code specifying which observatory to retrieve data for. Any of the observatory codes returned using the GetCapabilities request. No default - this value MUST be specified.
samplesPerDay The sample rate of the required data, specified in samples per day. The special codes 'Minute' (for 1440 samples per day) and 'Second' (for 86400 samples/day) are also recognised. Currently limited to 1440 (Minute) and 86400 (Second). Minute.
dataStartDate The start date for data. A date in the form yyyy-mm-dd. Yesterday
dataEndDate The end date for data. A date in the form yyyy-mm-dd. The maximum duration is 31 days for 1-second data and 366 days for minute mean data. One day after data start date.
dataDuration An alternative to dataEndData - the length of data. The maximum duration is 31 days for 1-second data and 366 days for minute mean data. An integer number of days. 1
publicationState The data's 'publication state' or data type.
  • "best-avail" - the best data available (also known as "adj-or-rep", see the section on what best available data means and how it is calculated)
  • "definitive" - definitive data
  • "quasi-def" - quasi-definitive data
  • "adjusted" - provisional (also called adjusted) data
  • "reported" - variometer (also called reported) data
  • "test" - test data
There is more information on data types in the INTERMAGNET technical reference manual: https://www.intermagnet.org/docs/Technical-Manual/technical_manual.pdf .
best-avail when testObsys==0; test (only valid when testObsys is set to 1)
recordTermination The type of record termination used with some data files. Only applies to data in the format iaga2002, imfv122 or wdc Windows; UNIX UNIX
orientation Only applies to data files (for magnetogram plots use the "traceList" parameter). Specifies the orientation the data should be presented in. For an explanation of the nomenclature used, see https://wdc.kugi.kyoto-u.ac.jp/element/eleexp.html.
  • Native - use the orientation the data provider sent the data in.
  • XYZF - cartesian coordinate system for vector data, total field calculated from vector data.
  • HDZF - cylindrical coordinate system for vector data, total field calculated from vector data.
  • DIFF - spherical coordinate system for vector data, total field calculated from vector data.
  • XYZS - cartesian coordinate system for vector data, total field from an independent instrument.
  • HDZS - cylindrical coordinate system for vector data, total field from an independent instrument.
  • DIFS - spherical coordinate system for vector data, total field from an independent instrument.
Native
traceList Only applies to magnetogram plots (for data files use the "orientation" parameter). This parameter should describe the list of traces to display. Each code in the list will add a new trace to the display. Codes are a single character.
  • 1 (first recorded component)
  • 2 (second recorded component)
  • 3 (third recorded component)
  • 4 (fourth recorded component)
  • X (geographic X component)
  • Y (geographic Y component)
  • Z (vertical component)
  • H (horizontal component)
  • D (declination), I (inclination)
  • F (total field calculated from vector data)
  • S (F total field from a scalar instrument)
  • C (difference in scalar and vector total field)
1234
colourTraces Only applies to magnetogram plots. Allows colouring of the magnetogram. true (for colour); false (for greyscale) true
pictureSize Only applies to png and jpg magnetogram plots. Sets the size of the plot, in pixels. A string in the form 'XXXxYYY' or 'XXX,YYY' or 'XXX YYY', where X is the width in pixels and Y is the height. Alternatively set to 'Automatic' to let the software calculate a reasonable value. Automatic
pdfSize Only applies to pdf magnetogram plots. The size of the PDF plot, in centimetres. Set to a string in the form 'XXXxYYY' or 'XXX,YYY' or 'XXX YYY', where X is the width in cm and Y is the height. 21.0x29.7 (A4)
dataScale Only applies to magnetogram plots. The vertical scale value for the plots Set to a string in the form 'XX nT / YY minutes' where XX is the height of the trace in nT (for field value traces) and YY is the height of the trace in minutes of arc (for angular value traces). Alternatively set this to 'Automatic' to allow the software to fit the plot to the size of the trace. Automatic

Use the Web Service URL Generator to see how to create URLs for this service.

Data directory service

The data directory service gives precise information on the amount of geomagnetic data available to the user. The following parameters may be used to control the data request:

>
Parameter Description Valid values Default value
Request Must be set to GetDataDirectory
Format The format that the data will be sent in. Available formats are: plain; html; json; xml. The plain format is similar to the format used with the previous e-mail data-directory service. xml
testObsys Whether to use the GIN's test observatories (set parameter to '1') or production observatories 1; 0 (but see test and production observatories in the embargo section). 0
observatoryIagaCodeList A comma separated list of three digit IAGA observatory codes specifying which observatories to retrieve directory information for. Any of the observatory codes returned using the GetCapabilities request. No default - this value MUST be specified.
samplesPerDay The sample rate of the required data, specified in samples per day. The special codes 'Minute' (for 1440 samples per day) and 'Second' (for 86400 samples/day) are also recognised. Currently limited to 1440 (Minute) and 86400 (Second). Minute.
dataStartDate The start date for data. A date in the form yyyy-mm-dd. Yesterday
dataDuration The length of data. An integer number of days. 1
publicationState The data's 'publication state' or data type.
  • "best-avail" - the best data available (also known as "adj-or-rep", see the section on what best available data means and how it is calculated)
  • "definitive" - definitive data
  • "quasi-def" - quasi-definitive data
  • "adjusted" - provisional (also called adjusted) data
  • "reported" - variometer (also called reported) data
  • "test" - test data
There is more information on data types in the INTERMAGNET technical reference manual: https://www.intermagnet.org/docs/Technical-Manual/technical_manual.pdf .
best-avail when testObsys==0; test (only valid when testObsys is set to 1)
optionsA comma separated list of options. Any option may be prefixed with 'no' to turn the option off (so for example, 'noheader' is a valid option).
  • header - only applies to plain text format - controls printing of the header
  • showgaps - prints detailed information on gaps (showing their start and end times
  • separationline - only applies to plain text format - controls printing of a line between each observatory.
   

Use the Web Service URL Generator to see how to create URLs for this service.

Data modification time service

The data modification time service allows users to retrieve the modification time of geomagnetic data. Observatories may submit data at any time and may overwrite previously submitted data. This service allows users to discover when data was modified, meaning that users are able to monitor for updates to data. Internally data supplied to the service is grouped by observatory, cadence, data type and day. Modification times can be retrieved for each individual day of data. The following parameters may be used to control the data request:

Parameter Description Valid values Default value
Request Must be set to GetDataModificationTime
Format The format that the data will be sent in. Available formats are: plain; html; json; xml. xml
testObsys Whether to use the GIN's test observatories (set parameter to '1') or production observatories. 1; 0 (but see test and production observatories in the embargo section). 0
observatoryIagaCodeList A comma separated list of three digit IAGA observatory codes specifying which observatories to retrieve directory information for. Any of the observatory codes returned using the GetCapabilities request. No default - this value MUST be specified.
samplesPerDay The sample rate of the required data, specified in samples per day. The special codes 'Minute' (for 1440 samples per day) and 'Second' (for 86400 samples/day) are also recognised. Currently limited to 1440 (Minute) and 86400 (Second). Minute.
dataStartDate The start date for data. A date in the form yyyy-mm-dd. Yesterday
dataDuration The length of data. An integer number of days. 1
publicationState The data's 'publication state' or data type.
  • "best-avail" - the best data available (also known as "adj-or-rep", see the section on what best available data means and how it is calculated)
  • "definitive" - definitive data
  • "quasi-def" - quasi-definitive data
  • "adjusted" - provisional (also called adjusted) data
  • "reported" - variometer (also called reported) data
  • "test" - test data
best-avail when testObsys==0; test (only valid when testObsys is set to 1)
dateFormat The format in which the modification time is returned.
  • "UNIXEpoch" - an integer representing the time as the number of seconds since 1970-01-01T00:00:00Z
  • "ISO8601" - a text representation of the time in ISO 8601 format.
UNIXEpoch

Use the Web Service URL Generator to see how to create URLs for this service.

Data lag time service

The data lag time service shows the difference between current time and the time of the most recently recorded sample from an observatory. The lag time is sampled once an hour for each observatory that sends data to the Edinburgh GIN. The lag time service allows operators to plot individual lag time figures for an observatory, also a monthly summary of lag times for all observatories. The following parameters may be used to control the data request:

>
Parameter Description Valid values Default value
Request Must be set to GetDataLagTime
Format The format that the data will be sent in. Available formats are: plain; html; xml; json; png; jpg; pdf. xml
testObsys Whether to use the GIN's test observatories (set parameter to '1') or production observatories 1; 0 (but see test and production observatories in the embargo section). 0
observatoryIagaCodeList A comma separated list of three digit IAGA observatory codes specifying which observatories to retrieve directory information for. Any of the observatory codes returned using the GetCapabilities request. An empty list, indicating that all observatories should be included in the returned results.
samplesPerDay The sample rate of the required data, specified in samples per day. The special codes 'Minute' (for 1440 samples per day) and 'Second' (for 86400 samples/day) are also recognised. Currently limited to 1440 (Minute) and 86400 (Second). Minute.
dataStartDate The start date for data. A date in the form yyyy-mm-dd. Start of the previous month
dataDuration The length of data. An integer number of days. Number of days in the month
thresholdA maximum value for the lag time - lag times larger than this value will be truncated to this value. The purpose of this option is to prevent very large lag times (which result from a station not sending data) from 'swamping' the plots, which are autoscaled. An integer number of minutes 72 x 60, ie 3 days, which is the time within which INTERMAGNET mandates that an observatory should transmit its data to the GIN.
chartType Only applies to plots. A bar chart is useful when comparing lag times across a number of observatories, whereas a line chart is more useful to see detailed data from a few observatories. Set 'bar' or 'line'. Bar
pictureSize Only applies to png and jpg magnetogram plots. Sets the size of the plot, in pixels. A string in the form 'XXXxYYY' or 'XXX,YYY' or 'XXX YYY', where X is the width in pixels and Y is the height. Alternatively set to 'Automatic' to let the software calculate a reasonable value. Automatic
pdfSize Only applies to pdf magnetogram plots. The size of the PDF plot, in centimetres. Set to a string in the form 'XXXxYYY' or 'XXX,YYY' or 'XXX YYY', where X is the width in cm and Y is the height. 21.0x29.7 (A4)

Use the Web Service URL Generator to see how to create URLs for this service.

Download script service

Providing bulk data downloads is a challenge for web service providers. Allowing too much data to be downloaded in one go can impact the performance of a web server. This system solves the problem by creating download scripts, which are retrieved by the user then run (on either UNIX or Windows or in Python) to download the data required by the user. The script is designed in such a way as to ease the burden on the web server. Because of this, no restrictions are placed on the amount of data that the user can download. Parameters fully control the data that the user requires - the download script will be created to allow retrieval of the data as specified in the parameter set. Further details are available on the download page of the interactive form.

Parameter Description Valid values Default value
Request Must be set to GetDownloadScript
Format The operating system that the script should be designed for. This also controls the record termination type for the data files that will be downloaded. Windows; UNIX Windows
testObsys Whether to use the GIN's test observatories (set parameter to '1') or production observatories 1; 0 (but see test and production observatories in the embargo section). 0
observatoryIagaCodeList Three digit IAGA observatory code specifying which observatories to retrieve data for. This parameter may be used more than once to specify as many observatories as are required. Any of the observatory codes returned using the GetCapabilities request. No default - this value MUST be specified.
samplesPerDay The sample rate of the required data, specified in samples per day. The special codes 'Minute' (for 1440 samples per day) and 'Second' (for 86400 samples/day) are also recognised. Currently limited to 1440 (Minute) and 86400 (Second). Minute.
publicationState The data's 'publication state' or data type.
  • "best-avail" - the best data available (also known as "adj-or-rep", see the section on what best available data means and how it is calculated)
  • "definitive" - definitive data
  • "quasi-def" - quasi-definitive data
  • "adjusted" - provisional (also called adjusted) data
  • "reported" - variometer (also called reported) data
  • "test" - test data
There is more information on data types in the INTERMAGNET technical reference manual: https://www.intermagnet.org/docs/Technical-Manual/technical_manual.pdf .
best-avail when testObsys==0; test (only valid when testObsys is set to 1)
orientation Specifies the orientation the data should be presented in. For an explanation of the nomenclature used, see https://wdc.kugi.kyoto-u.ac.jp/element/eleexp.html.
  • Native - use the orientation the data provider sent the data in.
  • XYZF - cartesian coordinate system for vector data, total field calculated from vector data.
  • HDZF - cylindrical coordinate system for vector data, total field calculated from vector data.
  • DIFF - spherical coordinate system for vector data, total field calculated from vector data.
  • XYZS - cartesian coordinate system for vector data, total field from an independent instrument.
  • HDZS - cylindrical coordinate system for vector data, total field from an independent instrument.
  • DIFS - spherical coordinate system for vector data, total field from an independent instrument.
Native
dataStartDate The start date for data. A date in the form yyyy-mm-dd. Yesterday
dataDuration The length of data. An integer number of days. 1
downloadDataFormat The format that the downloaded data will be sent in. iaga2002; imagcdf; imfv122; wdc.
iaga2002
folderOptions Options for the directory hierarchy to create to store the data in.
  • YearOnly - arrange all data from all observatories by year.
  • ObservatoryOnly - arrange all data from all years by observatory.
  • ObservatoryThenYear - put data into year directories under observatory directories.
  • YearThenObservatory - put data into observatory directories under year directories.
  • NoFolders - do not use any directories to organise the data.
YearThenObservatory
proxyAddress Address of the local proxy server. An address in the form [username:password@]address[:port] where username and password are the optional credentials needed to authenticate with the proxy server, address is the INTERNET name of the proxy server and port is the port address to use on the proxy server. Don't use a proxy server

Use the Web Service URL Generator to see how to create URLs for this service.

Monthly data statistics service

Statistics describing the amount of data received from each INTERMAGNET observatory are created on the 5th day of each month for the preceeding month. These statistics are emailed to all observatories and also archived. This service gives access to the archive. The archive consists of plain text files. Data are not available in any other format.

Each item in the archive has two dates:

  1. The date that the statistics refer to - a year and a month
  2. The date that the statistics were created on - a year, month and day. Typically this will be the 5th day of the month following the date that the statistics refer to, but it is possible that the statistics could be created on a different day, or that there could be multiple creation dates for the same statistics date.
Items in the archive are organised by their data type: reported; adjusted; quasi-definitive or definitive.

Parameter Description Valid values Default value
Request Must be set to GetMonthlyDataStatistics
Format The format that lists of statistics files will be sent in. The files themselves are always sent in text form. Lists of files can be sent in any of the formats listed json; txt txt
samplesPerDay The sample rate of the required data, specified in samples per day. The special codes 'Minute' (for 1440 samples per day) and 'Second' (for 86400 samples/day) are also recognised. Currently limited to 1440 (Minute) and 86400 (Second). Minute.
publicationState The 'publication state' or data type for which statistics are requested.
  • "definitive" - definitive data
  • "quasi-def" - quasi-definitive data
  • "adjusted" - provisional (also called adjusted) data
  • "reported" - variometer (also called reported) data
  • "test" - test data
There is more information on data types in the INTERMAGNET technical reference manual: https://www.intermagnet.org/docs/Technical-Manual/technical_manual.pdf .
reported
statisticsDate The date that the statistics refer to Dates in the form YYYY-MM If statisticsDate is missing, a list of all files for the given samplesPerDay and publicationState will be sent
creationDate The date that the statistics were created Dates in the form YYYY-MM-DD If creationDate is missing, a list of all statistics files for the given statisticsDate will be sent. Otherwise the file with the given statisticsDate and creationDate will be sent

Use the Web Service URL Generator to see how to create URLs for this service.

Data usage service

Each time a data file is downloaded from the Intermagnet web or ftp service, a record is made of the download. At the end of each day the total number of downloads for each observatory are recorded. At the end of the month these daily statistics are amalgamated into a monthly summary. These daily and monthly statistics on data downloads from the web and ftp servers are available through the data usage service.

Parameter Description Valid values Default value
Request Must be set to GetUsageStatistics
Format The format that statistics will be sent in json
StatisticsDate The date that the statistics refer to. To retrieve a day file specify day, month and year. To retrieve a monthly summary specify a month and year only. Dates in the form YYYY-MM or YYYY-MM-DD Last month

Use the Web Service URL Generator to see how to create URLs for this service.

Embargoing of data and plots

Data providers can specify an embargo period, during which data submitted to INTERMAGNET will not be distributed to users. The embargo period is specified in hours and applies to each observatory individually. Requests for data that is more recent than the embargo period will fail, showing the data as missing.

Organisations can apply to INTERMAGNET for a username/password to access this web service without the embargo being applied to their requests. Valid reasons for such a request include providing a service to the community that has been agreed with data providers, or an arrangement between a user and a data provider to supply data more rapidly than the embargo would allow.

To use a username provided for this purpose, there are two options:

  1. Send your http request using Basic authentication
  2. Append two parameters to each request sent to the web service:
    • "username" - the username
    • "password" - the password
If your authentication fails, the web service will not report the error and will continue as normal without authenticating the user (in which case the normal embargoes will apply).

The web sites at /GIN_V1/GINForms2 and /GIN_V1/GINTest2 provide a "Login" button where you can use the same username to get interactive access to the web service data using the permissions set up for any user credentials that you have access to.

To set up an embargo for an observatory or to apply for a username and password contact us using the "comments" link at the end of this page.

Test and production observatories

Associated with each username is a flag which specifies whether to allow access to production observatories, test observatories or both. This flag is set up by the administrator at the time the username is created. The flag overrides the function of the 'testObsys' query string parameter.

Best available data

Observatories record the geomagnetic field using a combination of automated computer measurements (high resolution variations) and manual measurements (low frequency "baseline" measurements). Manual measurements, typically taken with periods ranging from from days to weeks, are collected over time and a "best fit" baseline calculated in order to combine the manual time series with the automatically recorded computer measurements. New manual measurements may affect previous calculations of the baseline. For this reason a number of "publication states" (or "data types") have been defined to describe the state a data set is in, from initial recording to final publication. During the publication process data may also be edited to correct spikes or fill in gaps from an alternative recording system. The names of the publication states are:

  1. "reported" (or "variometer") data - newly recorded data without a baseline. This is a historic data type that data providers have been asked to stop sending.
  2. "adjusted" (or "provisional") data - data with a provisional baseline. The data may also have been edited. There is no guarantee how close the data values will be to the final values.
  3. "quasi-definitive" data - data with a provisional baseline where the accuracy is within a defined limit with respect to the final value.
  4. "definitive" data - data where all adjustments have been completed and the data provider has declared that no further changes will be made.
There is more information on data types in the INTERMAGNET technical reference manual: https://www.intermagnet.org/docs/Technical-Manual/technical_manual.pdf.

Calculation of "best available" data

The "best available" publication state is intended to provide you with the most "finished" data that the data provider has supplied. If definitive data is available for the observatory and time period requested, it will be provided. If not quasi-definitive data will be searched for, followed by adjusted data and finally reported data.

Data in the Edinburgh GIN is stored in files containing a day of data. When determining which type of data is available, the GIN searches to see which individual "day files" exist. For data requests spanning multiple days, the GIN will search the full span of days requested and if any data is present in this span for a particular publication state, then all the data returned will be for that publication state. Publication states will not be mixed in the data returned from a single request. This is true for data requested in all the formats that the service provides, both plots and data files.

Because the data service returns data sets that only contain a single publication state, the data directory and data modification time services also follow this behaviour. For a single request spanning multiple days, these services will return lists that refer to a single publication state across the entire span of time requested. If no data is found for any publication state within the requested time window, the returned information may show the "publication state" or "data type" as "none" (to indicate that no data was found). If multiple observatories are specified in these requests, each observatory's data may be returned with a different publication state.

If information is sought about the availability or modification time of the best available data for each day from an observatory, for a time span exceeding one day, there are two ways to approach this. The first is to split the request into multiple days, requesting the best available data for each day. The second is to make four requests, one for each data type (reported, adjusted, quasi-definite and definitive), each for the entire time span required, and to analyse the returned data yourself to determine the best available data for each day.


Terms of use: https://www.bgs.ac.uk/legal-and-policy/terms-of-use/

Cookie policy: https://www.bgs.ac.uk/legal-and-policy/cookies-policy/

Privacy policy: https://www.bgs.ac.uk/legal-and-policy/privacy/

Comments: Mail the GIN manager