# Earthquakes card

> Canonical HTML: https://screenrig.ai/docs/cards/earthquakes/

Recent earthquakes: the largest of the window as a big magnitude, a list of the latest with place, time and depth, and a seismogram of the day.

Category: Weather. Tags: Alerts and status, Weather and environment.

## Previews

![Earthquakes](/cards/earthquakes/v1/screenshots/canvas-bloom.webp?sha=163fbc3c735d619fd95c4f63070b31758d9983a678934cb15be83aa6894860b8)

Canvas

![Earthquakes](/cards/earthquakes/v1/screenshots/corner-bloom.webp?sha=2d6179c6be12544cc978cf4b302e6b455e4c40927e4297130a90c2b13b86007f)

Corner

![Earthquakes](/cards/earthquakes/v1/screenshots/chip-bloom.webp?sha=2bc95b5db5af25b82fdc6c1c6b3b437486143f96eff604322d47456a4dd80ec1)

Chip

## Views and forms

Views: canvas, corner, chip. Canvas forms: landscape, portrait, square, strip.

[Card views, themes and publishing](/docs/cards/). [Browse the gallery](/apps/#cards).

## Data and privacy

Feed: `screenrig.earthquakes/v1`.

Feed documents carry source attribution. The Player supplies the feed to the card.

## Properties

For theme, background, accent and position, see [Common properties](/docs/cards/#common-properties).

Set static properties in `params`. Bind `data` to a project card data key for live values; that document holds only dynamic properties. Without a data key, put the complete configuration in `params`. Nested rows describe the contents of their parent property.

### Static properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `title` | string | `"Earthquakes"` | maxLength: `40` |  |
| `area` | string | `""` | maxLength: `60` | Where the list covers, shown beside the title: Within 500 km of Vancouver. A feed's area name fills it when empty. |
| `windowHours` | integer | `24` | minimum: `1`; maximum: `168` | How far back the card looks. |
| `minMagnitude` | number | `2.5` | minimum: `0`; maximum: `9` |  |
| `count` | integer | `10` | minimum: `3`; maximum: `20` | Most rows in the list. |
| `sort` | string | `"recent"` | `"recent"`, `"largest"` |  |
| `units` | string | `"km"` | `"km"`, `"mi"` |  |
| `staleMinutes` | integer | `90` | minimum: `5`; maximum: `1440` |  |
| `hour12` | boolean | `false` |  |  |
| `location` | object |  | additionalProperties: `false` | Place the distances are measured from. Selects the feed. |
| `location.name` | string |  | maxLength: `40`; Required |  |
| `location.latitude` | number |  | minimum: `-90`; maximum: `90`; Required |  |
| `location.longitude` | number |  | minimum: `-180`; maximum: `180`; Required |  |
| `radiusKm` | number | `500` | minimum: `10`; maximum: `20000` | Quakes within this distance of the location. Selects the feed. |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `quakes` | array | `[]` | minItems: `0`; maxItems: `200` | Recent quakes. A feed (screenrig.earthquakes/v1) wins when present; the data store supplies the same rows otherwise. |
| `quakes[].id` | string |  | maxLength: `40` |  |
| `quakes[].time` | string |  | maxLength: `32`; Required | When it happened, ISO 8601. |
| `quakes[].magnitude` | number |  | minimum: `-2`; maximum: `10`; Required |  |
| `quakes[].place` | string |  | minLength: `1`; maxLength: `100`; Required | 12 km W of Ridgecrest, CA. |
| `quakes[].depthKm` | number |  | minimum: `0`; maximum: `800` |  |
| `quakes[].distanceKm` | number |  | minimum: `0`; maximum: `20000` | From the screen's place. |
| `quakes[].tsunami` | boolean | `false` |  |  |
| `updated` | string | `""` | maxLength: `32` | When the list was fetched, ISO 8601 (data store only; a feed carries fetchedAt). |

## Canvas example

Add this item to a playlist page’s `primitives`. [Publish the playlist and assign a screen](/docs/cards/#publish-a-card-canvas).

```json
{
  "id": "earthquakes",
  "primitive": "card",
  "card": "earthquakes",
  "major": 1,
  "params": {
    "theme": "neomustard",
    "location": {
      "name": "Vancouver",
      "latitude": 49.25,
      "longitude": -123.0
    }
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "earthquakes-main"
}
```

## Write live data

Create this document before showing the card, then replace it to update the screen without republishing. Use the same project as the playlist. Supply your API authorization through the environment; see [API authentication](/docs/authentication/).

```console
curl --request PUT "https://api.screenrig.ai/api/card-data/earthquakes-main" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "ScreenRig-Project: $SCREENRIG_PROJECT" \
  --header "Content-Type: application/json" \
  --data '{"document":{"quakes":[],"updated":""}}'
```
