Asset Search
API Endpoint: https://eoo9pxiv5yxg0za.m.pipedream.net
Cost: 0.2 NUM + Gas (~0.004 NUM per transaction) per API call. No Gas is required if paid with Credits.
Method: POST
Description:
This API finds digital assets registered on the Web3 network, by returning the exact Nid along with a list of similar assets if the requested file has been previously minted as NFT or registered on the Numbers network
Authentication:
This API requires a valid token for Authorization. The token should be passed in the headers of the request using the following format: "Authorization: token YOUR_CAPTURE_TOKEN"
Header:
Authorization: token $YOUR_CAPTURE_TOKEN (required)
Content-Type: application/json
Request Body (required):
fileURL (string) or
file (object) or
nid (string)
One of the three above must be provided
Request Body (optional):
threshold (float): distance threshold applied to filter similar results. The smaller the threshold, the tighter the restriction is. (No threshold is applied by default.)
sampleCount (int): how many similar results to be returned (default: 10)
isAssetTree (boolen): set this to true if the input is an AssetTree file. The API will look for the assetCid in the AssetTree for you.
Example 1 (direct file upload):
curl -F "file=@/tmp/MYFILE.png" \
-H "Authorization: token YOUR_CAPTURE_TOKEN" \
"https://eoo9pxiv5yxg0za.m.pipedream.net"
Example 2 (upload via URL)
curl -X POST "https://eoo9pxiv5yxg0za.m.pipedream.net" \
-H "Content-Type: application/json" \
-H "Authorization: token YOUR_CAPTURE_TOKEN" \
-d '{
"fileURL": YOUR_FILE_URL,
"threshold": 0.12
}'
Response:
{
"preciseSearch": nid, // Nid of the precise search result if found
"inputFileMimetypr": mimetype, // Minetype of the input file
"similarSearch": {
"nids": list_of_similar_asset_nids,
"distance": list_of_asset_distanct
},
"orderID": string // ID of this order
}
200: File has been pinned successfully
400: Bad request
401: Unauthorized
403: Forbidden
500: Internal Server Error
Last updated