# blue.microcosm.links.getBacklinksCount

> Published by [microcosm.blue](https://lexicon.garden/identity/did:plc:lulmyldiq4sb2ikags5sfb25)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.links.getBacklinksCount)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.links.getBacklinksCount/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.links.getBacklinksCount/examples)

## Definitions

### `blue.microcosm.links.getBacklinksCount`

**Type**: `query`

count records that link to another record

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `source` | `string` | Yes | collection and path specification for the primary link |
| `subject` | `string` (uri) | Yes | the primary target being linked to (at-uri, did, or uri) |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `total` | `integer` | Yes | total number of matching links |

## Raw Schema

```json
{
  "id": "blue.microcosm.links.getBacklinksCount",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "total"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "description": "total number of matching links"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "subject",
          "source"
        ],
        "properties": {
          "source": {
            "type": "string",
            "description": "collection and path specification for the primary link"
          },
          "subject": {
            "type": "string",
            "format": "uri",
            "description": "the primary target being linked to (at-uri, did, or uri)"
          }
        }
      },
      "description": "count records that link to another record"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
