This API allows you to check if the Nid/Cid is accessible on IPFS network through the Numbers Gateway. You need both the Capture Token and the Nid for this process. If you do not already have a Capture Token yet, please follow the instruction provided to create one.
API Endpoint: https://eobf91xa1ra7i2n.m.pipedream.net
Cost: 0.01 NUM
Method: POST
Description:
This API endpoint allows developers to check if a Nid/Cid is accessible from the Numbers Gateway (https://ipfs-pin.numbersprotocol.io/ipfs/).
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):
nid (string): Nid to be checked.
Example:
curl -X POST "https://eobf91xa1ra7i2n.m.pipedream.net" \
-H "Content-Type: application/json" \
-H "Authorization: token YOUR_CAPTURE_TOKEN" \
-d '{
"nid": NID_TO_CHECK
}'
Response:
{
"nid": NID_TO_CHECK,
"on_ipfs": true
}
200: Check API successful.
400: Bad request
401: Unauthorized
403: Forbidden
500: Internal Server Error
A detailed explanation of the Nid can be found on the Numbers ID (Nid) page. In this example, you would replace YOUR_CAPTURE_TOKEN with your actual Capture token and NID_TO_CHECK with the Nid you want to unpin. More examples can be found below:
import requests
url = "https://eobf91xa1ra7i2n.m.pipedream.net"
headers = {
"Content-Type": "application/json",
"Authorization": "token YOUR_CAPTURE_TOKEN"
}
data = {
"nid": NID_TO_CHECK
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
response_json = response.json()
print(response_json)
else:
print("Request failed with status code:", response.status_code)