# social.grain.unspecced.getLocations

> Get top locations by gallery count.

- Kind: query
- Authority: unspecced.grain.social
- Lexicon: 1
- Published by [grain.social](https://lexicon.garden/identity/did:plc:e7rftrdyz5e2rw4y6ocszew2), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.unspecced.getLocations)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.unspecced.getLocations/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:e7rftrdyz5e2rw4y6ocszew2/social.grain.unspecced.getLocations/analytics)

## Query (`social.grain.unspecced.getLocations`)

Type: query · GET

### Parameters (query string)

- `pins` (boolean): Return every place carrying only what a map needs — name, h3Index, galleryCount — instead of the top 30 with thumbnails and cell lists. The full shape is ~1.1KB per place, so all of them would be ~780KB; lean it is ~70 bytes each.

### Output (application/json)

- `locations` (array)
  - `items` (ref)
    - Reference: `social.grain.unspecced.getLocations#locationItem`

## #locationItem (`social.grain.unspecced.getLocations#locationItem`)

Type: object

### Properties

- `galleryCount` (integer, required)
- `h3Cells` (array): All H3 cells whose galleries map to this place. Ordered by gallery count desc.
  - `items` (string)
- `h3Index` (string, required): Canonical H3 cell for the place (densest cell in the group).
- `name` (string, required)
- `thumbs` (array): Up to four representative photo thumbnails, most recent first. Lets the index render without a feed request per location.
  - Constraints: maxLength: 4
  - `items` (string · uri)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "locationItem": {
      "properties": {
        "galleryCount": {
          "type": "integer"
        },
        "h3Cells": {
          "description": "All H3 cells whose galleries map to this place. Ordered by gallery count desc.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "h3Index": {
          "description": "Canonical H3 cell for the place (densest cell in the group).",
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "thumbs": {
          "description": "Up to four representative photo thumbnails, most recent first. Lets the index render without a feed request per location.",
          "items": {
            "format": "uri",
            "type": "string"
          },
          "maxLength": 4,
          "type": "array"
        }
      },
      "required": [
        "name",
        "h3Index",
        "galleryCount"
      ],
      "type": "object"
    },
    "main": {
      "description": "Get top locations by gallery count.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "locations": {
              "items": {
                "ref": "social.grain.unspecced.getLocations#locationItem",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "pins": {
            "description": "Return every place carrying only what a map needs — name, h3Index, galleryCount — instead of the top 30 with thumbnails and cell lists. The full shape is ~1.1KB per place, so all of them would be ~780KB; lean it is ~70 bytes each.",
            "type": "boolean"
          }
        },
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "social.grain.unspecced.getLocations",
  "lexicon": 1
}
```
