Skip to main content

BAS CSW - Usage

General information

CSW (Catalogue Service for the Web) is an OGC (Open Geospatial Consortium) specification that defines common interfaces to discover, browse, and query metadata about data, services, and other potential resources.

The UK Polar Data Centre (UKPDC) and the British Antarctic Survey (BAS) provide access to it’s catalogue for distribution and discovery of metadata about datasets, services and other information objects.

Support

Contact the BAS Service Desk for support.

Interacting with the BAS CSW service

The BAS CSW service is implemented using pycsw. pycsw is a widely used and certified OGC compliant CSW server written in Python. The service provides endpoints for CSW clients to integrate with.

The endpoints support the OGC CSW 2.0.2 standard as well as the ISO Metadata Application 1.0.0 Profile. The CSW endpoints operate over HTTP GET and POST (XML).

Base URL

The base URL for this API is: https://api.bas.ac.uk/data/metadata/csw/v2/

Note: This API is only available over HTTPS.

Making requests

GetCapabilities

The GetCapabilities operation gives CSW clients the ability to get service metadata from the server, returned as an XML document.

Example GET request:

https://api.bas.ac.uk/data/metadata/csw/v2/?service=CSW&version=2.0.2&request=GetCapabilities&outputSchema=http:%2F%2Fwww.isotc211.org%2F2005%2Fgmd

Example POST request:

<?xml version="1.0" encoding="UTF-8"?>
<csw:GetCapabilities xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW">
   <ows:AcceptVersions xmlns:ows="http://www.opengis.net/ows">
      <ows:Version>2.0.2</ows:Version>
   </ows:AcceptVersions>
   <ows:AcceptFormats xmlns:ows="http://www.opengis.net/ows">
      <ows:OutputFormat>application/xml</ows:OutputFormat>
   </ows:AcceptFormats>
</csw:GetCapabilities>

URL: https://api.bas.ac.uk/data/metadata/csw/v2

Content-type: application/xml

GetRecords

Example GET request:

https://api.bas.ac.uk/data/metadata/csw/v2/?service=CSW&version=2.0.2&request=GetRecords&typenames=csw:Record&elementsetname=brief&resulttype=results&startPosition=1

Example POST request:

<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dif="http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/" xmlns:fgdc="http://www.opengis.net/cat/csw/csdgm" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:ows="http://www.opengis.net/ows" outputFormat="application/xml" outputSchema="http://www.opengis.net/cat/csw/2.0.2" resultType="results" startPosition="1" service="CSW" version="2.0.2">
   <csw:Query typeNames="csw:Record">
      <csw:ElementSetName>brief</csw:ElementSetName>
   </csw:Query>
</csw:GetRecords>

URL: https://api.bas.ac.uk/data/metadata/csw/v2

Content-type: application/xml

GetRecordById

Example GET requests:

For ISO 19139 output schema:

https://api.bas.ac.uk/data/metadata/csw/v2/?service=CSW&version=2.0.2&request=GetRecordById&elementsetname=full&outputSchema=http:%2F%2Fwww.isotc211.org%2F2005%2Fgmd&id=GB%2FNERC%2FBAS%2FPDC%2F01117

For Dublin Core output schema:

https://api.bas.ac.uk/data/metadata/csw/v2/?service=CSW&version=2.0.2&request=GetRecordById&elementsetname=full&id=GB%2FNERC%2FBAS%2FPDC%2F01117

Example POST request:

<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecordById xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" service="CSW" version="2.0.2">
   <csw:Id>GB/NERC/BAS/PDC/01117</csw:Id>
   <csw:ElementSetName>full</csw:ElementSetName>
</csw:GetRecordById>

URL: https://api.bas.ac.uk/data/metadata/csw/v2/

Content-type: application/xml

Versioning policy

This API is versioned. An API version must be specified as a URL prefix e.g. /v1/foo.

Only the latest, stable, API version is supported. When a new version is released previous versions are deprecated.

Testing version

For testing new features and changes, a non-stable, testing version of this API is available. This version should only be used in development environments, when recommended by support.

The base URL of the testing version is: https://api.bas.ac.uk/data/metadata/csw/testing.