# fyi.opensocial.listSiteRecords

> Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.listSiteRecords)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.listSiteRecords/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.listSiteRecords/examples)

## Definitions

### `fyi.opensocial.listSiteRecords`

**Type**: `query`

Records of one collection from the host's index, newest first. Without `repo`, a collection the group's site declares it reads, from the group (answered to anyone) or its members (members only). With `repo`, that one account's records — the group's or a member's — of any collection, kept on demand once asked for; members only. `field` and `equals` keep only records whose field (a name, or a path like subject.uri) equals that value. With `from: "network"`, everyone's records of the collection, from every account on the network that writes it: answered to anyone once the host keeps it, which it does from when a saved page declares it, unless too many accounts write it; `filling` says it is still being gathered. With `repos`, each of those accounts' newest record of any collection, such as each one's profile, answered to anyone; an account not heard from in time is left out, and fills in for the next read.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `collection` | `string` (nsid) | Yes |  |
| `cursor` | `string` | No | With `from: "network"`: from the last page, for older records. |
| `equals` | `string` | No |  |
| `field` | `string` | No | Only records whose field (a name or a dotted path) equals `equals`. |
| `from` | `string` | No | Without `repo`: the group's records, its members', or everyone's on the network. |
| `group` | `string` (did) | Yes |  |
| `limit` | `integer` | No |  |
| `repo` | `string` (did) | No | One account's records: the group's or a member's. |
| `repos` | `array` | No | Many accounts, anyone's: each one's newest record of the collection. |
| `search` | `string` | No | With `from: "network"`: records whose words have any of these words, "quoted phrases" kept together, a trailing * for a prefix, and AND, OR and NOT for more. |
| `sort` | `string` | No | With `from: "network"` and a search: newest first, or the most relevant first. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cursor` | `string` | No | With `from: "network"`, when there are older records. |
| `filling` | `boolean` | No | With `from: "network"`: the host is still gathering the collection, so older records may be missing. |
| `records` | `array` | Yes |  |

#### Errors

- **NotFound**
- **NotDeclared**
- **NotAuthorized**
- **NotKept**
- **TooLarge**
- **TooMany**

### `fyi.opensocial.listSiteRecords#siteRecord`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | No |  |
| `createdAt` | `string` (datetime) | No |  |
| `handle` | `string` (handle) | No | With `from: "network"` or `repos`: the account's handle, when it's known. |
| `repo` | `string` (did) | Yes |  |
| `uri` | `string` (at-uri) | Yes |  |
| `value` | `unknown` | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Records of one collection from the host's index, newest first. Without `repo`, a collection the group's site declares it reads, from the group (answered to anyone) or its members (members only). With `repo`, that one account's records — the group's or a member's — of any collection, kept on demand once asked for; members only. `field` and `equals` keep only records whose field (a name, or a path like subject.uri) equals that value. With `from: \"network\"`, everyone's records of the collection, from every account on the network that writes it: answered to anyone once the host keeps it, which it does from when a saved page declares it, unless too many accounts write it; `filling` says it is still being gathered. With `repos`, each of those accounts' newest record of any collection, such as each one's profile, answered to anyone; an account not heard from in time is left out, and fills in for the next read.",
      "errors": [
        {
          "name": "NotFound"
        },
        {
          "name": "NotDeclared"
        },
        {
          "name": "NotAuthorized"
        },
        {
          "name": "NotKept"
        },
        {
          "name": "TooLarge"
        },
        {
          "name": "TooMany"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cursor": {
              "description": "With `from: \"network\"`, when there are older records.",
              "type": "string"
            },
            "filling": {
              "description": "With `from: \"network\"`: the host is still gathering the collection, so older records may be missing.",
              "type": "boolean"
            },
            "records": {
              "items": {
                "ref": "#siteRecord",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "records"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "collection": {
            "format": "nsid",
            "type": "string"
          },
          "cursor": {
            "description": "With `from: \"network\"`: from the last page, for older records.",
            "maxLength": 1024,
            "type": "string"
          },
          "equals": {
            "maxLength": 2048,
            "type": "string"
          },
          "field": {
            "description": "Only records whose field (a name or a dotted path) equals `equals`.",
            "maxLength": 128,
            "type": "string"
          },
          "from": {
            "description": "Without `repo`: the group's records, its members', or everyone's on the network.",
            "knownValues": [
              "group",
              "members",
              "network"
            ],
            "type": "string"
          },
          "group": {
            "format": "did",
            "type": "string"
          },
          "limit": {
            "default": 50,
            "maximum": 100,
            "minimum": 1,
            "type": "integer"
          },
          "repo": {
            "description": "One account's records: the group's or a member's.",
            "format": "did",
            "type": "string"
          },
          "repos": {
            "description": "Many accounts, anyone's: each one's newest record of the collection.",
            "items": {
              "format": "did",
              "type": "string"
            },
            "maxLength": 100,
            "type": "array"
          },
          "search": {
            "description": "With `from: \"network\"`: records whose words have any of these words, \"quoted phrases\" kept together, a trailing * for a prefix, and AND, OR and NOT for more.",
            "maxLength": 512,
            "type": "string"
          },
          "sort": {
            "default": "newest",
            "description": "With `from: \"network\"` and a search: newest first, or the most relevant first.",
            "knownValues": [
              "newest",
              "relevance"
            ],
            "type": "string"
          }
        },
        "required": [
          "group",
          "collection"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "siteRecord": {
      "properties": {
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "handle": {
          "description": "With `from: \"network\"` or `repos`: the account's handle, when it's known.",
          "format": "handle",
          "type": "string"
        },
        "repo": {
          "format": "did",
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        },
        "value": {
          "type": "unknown"
        }
      },
      "required": [
        "uri",
        "repo",
        "value"
      ],
      "type": "object"
    }
  },
  "id": "fyi.opensocial.listSiteRecords",
  "lexicon": 1
}
```
