BSV blockchainBSV blockchain

Find the download URL(s) for a UHRP URL (inferred)

GET/find

Queries this server’s knowledge of advertisement tokens for the given UHRP URL. Returns one or more download URLs if the server is currently advertising the content, or 404 if not found.

Query Parameters

uhrpUrlstringrequired

The UHRP URL to resolve. May be bare Base58Check or prefixed with uhrp://.

Response

Content found; download URLs returned.

uhrpUrlstring

The resolved UHRP URL (echoed from query parameter).

urlsstring<uri>[]

One or more HTTPS download URLs where the content is currently available. Clients SHOULD try each in order and use the first that responds successfully.

expiresAtinteger

UNIX timestamp of the earliest advertisement token expiry across all returned hosts.

contentLengthinteger

Byte length of the content as advertised in the token.

Bad request — invalid input.

errorstring

Human-readable error description.

codestring

Machine-readable error code (see specs/errors.md).

The requested UHRP URL is not known to this server.

errorstring

Human-readable error description.

codestring

Machine-readable error code (see specs/errors.md).

Internal server error.

errorstring

Human-readable error description.

codestring

Machine-readable error code (see specs/errors.md).

Request
curl -X GET "https://{host}/find?uhrpUrl=<uhrpUrl>"
Response
{
  "uhrpUrl": "uhrp://XYZ123abc...",
  "urls": [
    "https://storage.example.com/files/abc123"
  ],
  "expiresAt": 1714100000,
  "contentLength": 204800
}