···11# link_aggregator
2233+## endpoints
44+55+terms as used here:
66+77+- "URI": a URI, AT-URI, or DID.
88+- "JSON path": a dot-separated (and dot-prefixed, for now) path to a field in an atproto record. Arrays are noted by `[]` and cannot contain a specific index.
99+1010+### `GET /links/count`
1111+1212+The number of backlinks to a URI from a specified collection + json path.
1313+1414+Required URL parameters
1515+1616+- `target` (required): the URI. must be URL-encoded.
1717+ - example: `at%3A%2F%2Fdid%3Aplc%3A57vlzz2egy6eqr4nksacmbht%2Fapp.bsky.feed.post%2F3lg2pgq3gq22b`
1818+- `collection` (required): the source NSID of referring documents to consider.
1919+ - example: `app.bsky.feed.post`
2020+- `path` (required): the JSON path in referring documents to consider.
2121+ - example: `.subject.uri`
2222+2323+cURL Example: Get a count of all bluesky likes for a post
2424+2525+```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'
2727+2828+40
2929+```
3030+331432some todos
533