Skip to content

Samples

Get samples

  • URL: /api/v2/:region/sample?page=:page&size=:size

  • URL Parameters:

    • region which must be one of antarctica or greenland
  • Query Parameters:

    • page: the number of samples to skip. Optional and defaults to 0
    • size: the maximum number of samples to return. Optional and defaults to 1000
  • Method: GET

  • Success Response:

    • Code: 200
    • Content example:
      {
        "items": {
          "type": "FeatureCollection",
          "features": [
            {
              "type": "Feature",
              "geometry": {
                "type": "Point",
                "coordinates": [
                  -53.1182,
                  68.4493
                ]
              },
              "properties": {
                "id": 20535,
                "sample_name": "13GRO-21",
                "elv_m": 144,
                "shielding": 1,
                "thick_cm": 2,
                "lithology": "Granite",
                "site": "NATN2",
                "density": 2.65,
                "comments": null,
                "what": "erratic boulder",
                "collected_by": null,
                "date_collected": null,
                "shielding_azimuths": null,
                "shielding_elevations": null,
                "local_ice_surface_m": null,
                "surfpt_id": null,
                "USPRR_DB_id": null,
                "surface_strike": null,
                "surface_dip": null
              }
            },
            {
              "type": "Feature",
              "geometry": {
                "type": "Point",
                "coordinates": [
                  -52.4822,
                  68.2588
                ]
              },
              "properties": {
                "id": 20531,
                "sample_name": "13GRO-13",
                "elv_m": 234,
                "shielding": 1,
                "thick_cm": 2,
                "lithology": "Granite",
                "site": "NATN3",
                "density": 2.65,
                "comments": null,
                "what": "erratic boulder",
                "collected_by": null,
                "date_collected": null,
                "shielding_azimuths": null,
                "shielding_elevations": null,
                "local_ice_surface_m": null,
                "surfpt_id": null,
                "USPRR_DB_id": null,
                "surface_strike": null,
                "surface_dip": null
              }
            }
          ]
        },
        "pageSize": 2,
        "pageIndex": 100,
        "numTotal": 891,
        "hasMore": true
      }
      
      • Notes:
        • This returns a JSON object with the following properties:
        • items a GeoJSON FeatureCollection
        • pageSize the number of samples
        • pageIndex the number of samples skipped
        • numTotal the total number of samples for the region
        • hasMore true if there are more samples for the given pageSize and pageIndex
  • Usage Examples:

    • Using Python:
      • This example will fetch all samples from the greenland region

        from urllib import request
        import json
        samples = []
        offset = 0
        size = 200
        while True:
            url = f'https://iced-samples.apps.pgc.umn.edu/api/v2/greenland/sample?page={offset}&size={size}'
            response = request.urlopen(url)
            if response.code == 200:
                payload = response.read()
                j = json.loads(payload)
                has_more = j['hasMore']
                items = j['items']
                samples.extend(items['features'])
                offset += size
                if not has_more:
                    break
            else:
                break