···11111212The number of backlinks to a URI from a specified collection + json path.
13131414-Required URL parameters
1414+#### Required URL parameters
15151616- `target` (required): the URI. must be URL-encoded.
1717 - example: `at%3A%2F%2Fdid%3Aplc%3A57vlzz2egy6eqr4nksacmbht%2Fapp.bsky.feed.post%2F3lg2pgq3gq22b`
···2020- `path` (required): the JSON path in referring documents to consider.
2121 - example: `.subject.uri`
22222323-cURL Example: Get a count of all bluesky likes for a post
2323+#### Response
2424+2525+A number (u64) in plain text format
2626+2727+#### cURL example: Get a count of all bluesky likes for a post
24282529```bash
2626-curl 'http://raspberrypi.local:6789/links/count?target=at%3A%2F%2Fdid%3Aplc%3A57vlzz2egy6eqr4nksacmbht%2Fapp.bsky.feed.post%2F3lg2pgq3gq22b&collection=app.bsky.feed.like&path=.subject.uri'
3030+curl '<HOST>/links/count?target=at%3A%2F%2Fdid%3Aplc%3A57vlzz2egy6eqr4nksacmbht%2Fapp.bsky.feed.post%2F3lg2pgq3gq22b&collection=app.bsky.feed.like&path=.subject.uri'
2731283240
3333+```
3434+3535+### `GET /links/all/count`
3636+3737+The number of backlinks to a URI from any source collection or json path
3838+3939+#### Required URL parameters
4040+4141+- `target` (required): the URI. must be URL-encoded.
4242+ - example: `did:plc:vc7f4oafdgxsihk4cry2xpze`
4343+4444+#### Response
4545+4646+A JSON object `{[NSID]: {[JSON path]: [N]}}`
4747+4848+#### cURL example: Get reference counts to a DID from any collection at any path
4949+5050+```bash
5151+curl '<HOST>/links/all/count?target=did:plc:vc7f4oafdgxsihk4cry2xpze'
5252+5353+curl '<HOST>/links/all/count?target=did:plc:vc7f4oafdgxsihk4cry2xpze'
5454+{
5555+ "app.bsky.graph.block": { ".subject": 13 },
5656+ "app.bsky.graph.follow": { ".subject": 159 },
5757+ "app.bsky.feed.post": { ".facets[].features[].did": 16 },
5858+ "app.bsky.graph.listitem": { ".subject": 6 },
5959+ "app.bsky.graph.starterpack":
6060+ {
6161+ ".feeds[].creator.did": 1,
6262+ ".feeds[].creator.labels[].src": 1
6363+ }
6464+}
2965```
30663167