The following API helps you cat metadata with IPFS Nid from Numbers IPFS gateway. Capture Token and the Nid of the asset are required. If you do not already have a Capture Token yet, please follow the instruction provided to create one.
API Endpoint: https://eoilb27dj3s5ncc.m.pipedream.netCost:0.01NUMMethod:GETEndpoint:/?nid=NID_TO_FETCHDescription:This API endpoint allows developers to retrieve metadata on IPFS via the Numbers Gateway (https://ipfs-pin.numbersprotocol.io/ipfs/) using a Nid. The returned data is a string containing the metadata associated with the provided Nid.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"Headers:- Content-Type: application/json- Authorization: token YOUR_CAPTURE_TOKENExamples:curl -XGET-H"Content-Type: application/json" \-H"Authorization: token YOUR_CAPTURE_TOKEN" \ https://eoilb27dj3s5ncc.m.pipedream.net?nid=NID_TO_FETCHResponse:A string containing the metadata associated with the provided Nid.
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_FETCH with the Nid of the metadata you want to cat. More examples can be found below:
import requestsimport json# Define the API endpointurl ="https://eoilb27dj3s5ncc.m.pipedream.net"# Define the headers for the requestheaders ={"Content-Type":"application/json","Authorization":"token YOUR_CAPTURE_TOKEN"# Replace YOUR_CAPTURE_TOKEN with your own}# Define the parameters for the requestparams ={"nid": NID_TO_FETCH}# Replace NID_TO_FETCH with the Nid of the metadata you want to retrieve# Send the GET request to the API endpointresponse = requests.get(url, headers=headers, params=params)# Check the response status codeif response.status_code !=200:print(f"Error: {response.status_code} - {response.text}")else:# Parse the JSON response json_data = response.json() ipfs_data = json.loads(json_data["data"]) order_id = json.loads(json_data["order_id"])print(ipfs_data.keys())