The myCognitor API provides programmatic access to our digital witnessing and intellectual property verification services. Our REST API allows you to submit documents, verify certificates, and integrate IP protection into your applications.
https://mycognitor.bloccfeed.space/api/v1All API responses are returned in JSON format with the following structure:
The myCognitor API uses API keys for authentication. Include your API key in the request headers:
1. Visit the Developer Dashboard
2. Sign in with your email address
3. Generate a new API key
4. Copy and securely store your API key
API requests are rate-limited based on your subscription plan:
| Plan | Requests per Hour | Requests per Day | Requests per Month |
|---|---|---|---|
| Free | 10 | 100 | 1,000 |
| Basic | 100 | 1,000 | 10,000 |
| Pro | 1,000 | 10,000 | 100,000 |
| Enterprise | Unlimited | Unlimited | Unlimited |
Rate limit information is included in response headers:
/api/v1/submit
Submit a document or text for verification and timestamping.
| Parameter | Type | Required | Description |
|---|---|---|---|
title |
string | Required | Title or name for the submission |
type |
string | Required | Either "file" or "text" |
file |
file | Optional | File to upload (required if type="file") |
content |
string | Optional | Text content (required if type="text") |
plan |
string | Optional | Verification plan: "basic", "standard", "professional" |
/api/v1/verify/{certificate_id}
Verify the authenticity of a certificate by its ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
certificate_id |
string | Required | The certificate ID to verify |
/api/v1/status/{certificate_id}
Check the processing status of a submitted document.
Use axios or fetch for HTTP requests:
class MyCognitorClient {
constructor(apiKey, baseUrl = 'https://mycognitor.bloccfeed.space/api/v1/') {
this.apiKey = apiKey;
this.baseUrl = baseUrl;
}
async submit(title, file = null, content = null, plan = 'basic') {
const formData = new FormData();
formData.append('title', title);
formData.append('plan', plan);
if (file) {
formData.append('type', 'file');
formData.append('file', file);
} else if (content) {
formData.append('type', 'text');
formData.append('content', content);
} else {
throw new Error('Either file or content must be provided');
}
try {
const response = await fetch(`${this.baseUrl}submit`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${this.apiKey}`
},
body: formData
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
} catch (error) {
throw new Error(`Submit failed: ${error.message}`);
}
}
async verify(certificateId) {
try {
const response = await fetch(`${this.baseUrl}verify/${certificateId}`, {
headers: {
'Authorization': `Bearer ${this.apiKey}`
}
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
} catch (error) {
throw new Error(`Verification failed: ${error.message}`);
}
}
}
// Usage Example
const client = new MyCognitorClient('YOUR_API_KEY');
// Submit a file from file input
document.getElementById('fileInput').addEventListener('change', async (event) => {
const file = event.target.files[0];
if (file) {
try {
const result = await client.submit('My Innovation', file, null, 'standard');
console.log('Certificate ID:', result.data.certificate_id);
console.log('Download URL:', result.data.certificate_url);
} catch (error) {
console.error('Error:', error.message);
}
}
});
// Submit text content
async function submitText() {
try {
const result = await client.submit(
'My Idea',
null,
'This is my innovative concept...',
'basic'
);
console.log('Success:', result.data.certificate_id);
} catch (error) {
console.error('Error:', error.message);
}
}const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
class MyCognitorClient {
constructor(apiKey, baseUrl = 'https://mycognitor.bloccfeed.space/api/v1/') {
this.client = axios.create({
baseURL: baseUrl,
headers: {
'Authorization': `Bearer ${apiKey}`
}
});
}
async submitFile(title, filePath, plan = 'basic') {
try {
const form = new FormData();
form.append('title', title);
form.append('type', 'file');
form.append('file', fs.createReadStream(filePath));
form.append('plan', plan);
const response = await this.client.post('submit', form, {
headers: form.getHeaders()
});
return response.data;
} catch (error) {
throw new Error(`Submit failed: ${error.response?.data?.message || error.message}`);
}
}
async submitText(title, content, plan = 'basic') {
try {
const response = await this.client.post('submit', {
title,
type: 'text',
content,
plan
});
return response.data;
} catch (error) {
throw new Error(`Submit failed: ${error.response?.data?.message || error.message}`);
}
}
async verify(certificateId) {
try {
const response = await this.client.get(`verify/${certificateId}`);
return response.data;
} catch (error) {
throw new Error(`Verification failed: ${error.response?.data?.message || error.message}`);
}
}
}
// Usage
const client = new MyCognitorClient('YOUR_API_KEY');
async function example() {
try {
// Submit a file
const fileResult = await client.submitFile('My Innovation', './document.pdf', 'standard');
console.log('File Certificate:', fileResult.data.certificate_id);
// Submit text
const textResult = await client.submitText('My Idea', 'Innovative concept...', 'basic');
console.log('Text Certificate:', textResult.data.certificate_id);
// Verify certificate
const verification = await client.verify('CERT-2025-ABC12345');
console.log('Valid:', verification.data.status === 'valid');
} catch (error) {
console.error('Error:', error.message);
}
}
example();Use requests library for HTTP requests:
import requests
import json
from typing import Optional, Dict, Any
class MyCognitorClient:
def __init__(self, api_key: str, base_url: str = 'https://mycognitor.bloccfeed.space/api/v1/'):
self.api_key = api_key
self.base_url = base_url.rstrip('/')
self.headers = {
'Authorization': f'Bearer {api_key}'
}
def submit_file(self, title: str, file_path: str, plan: str = 'basic') -> Dict[Any, Any]:
"""Submit a file for verification"""
try:
with open(file_path, 'rb') as file:
files = {
'file': (file_path.split('/')[-1], file, 'application/octet-stream')
}
data = {
'title': title,
'type': 'file',
'plan': plan
}
response = requests.post(
f'{self.base_url}/submit',
headers=self.headers,
files=files,
data=data
)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
raise Exception(f'Submit failed: {str(e)}')
except FileNotFoundError:
raise Exception(f'File not found: {file_path}')
def submit_text(self, title: str, content: str, plan: str = 'basic') -> Dict[Any, Any]:
"""Submit text content for verification"""
try:
data = {
'title': title,
'type': 'text',
'content': content,
'plan': plan
}
response = requests.post(
f'{self.base_url}/submit',
headers=self.headers,
json=data
)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
raise Exception(f'Submit failed: {str(e)}')
def verify(self, certificate_id: str) -> Dict[Any, Any]:
"""Verify a certificate"""
try:
response = requests.get(
f'{self.base_url}/verify/{certificate_id}',
headers=self.headers
)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
raise Exception(f'Verification failed: {str(e)}')
def get_status(self, certificate_id: str) -> Dict[Any, Any]:
"""Get submission status"""
try:
response = requests.get(
f'{self.base_url}/status/{certificate_id}',
headers=self.headers
)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
raise Exception(f'Status check failed: {str(e)}')
# Usage Example
if __name__ == '__main__':
client = MyCognitorClient('YOUR_API_KEY')
try:
# Submit a file
file_result = client.submit_file('My Innovation', 'document.pdf', 'standard')
print(f"File Certificate ID: {file_result['data']['certificate_id']}")
print(f"Download URL: {file_result['data']['certificate_url']}")
# Submit text content
text_result = client.submit_text('My Idea', 'This is my innovative concept...', 'basic')
print(f"Text Certificate ID: {text_result['data']['certificate_id']}")
# Verify a certificate
verification = client.verify('CERT-2025-ABC12345')
is_valid = verification['data']['status'] == 'valid'
print(f"Certificate valid: {is_valid}")
if is_valid:
print(f"Title: {verification['data']['title']}")
print(f"Timestamp: {verification['data']['timestamp_utc']}")
print(f"Hash: {verification['data']['hash']}")
except Exception as e:
print(f"Error: {e}")Use Guzzle HTTP client for PHP integration:
<?php
require_once 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
class MyCognitorClient {
private $client;
private $apiKey;
public function __construct($apiKey, $baseUrl = 'https://mycognitor.bloccfeed.space/api/v1/') {
$this->apiKey = $apiKey;
$this->client = new Client([
'base_uri' => $baseUrl,
'headers' => [
'Authorization' => 'Bearer ' . $apiKey,
'Accept' => 'application/json'
]
]);
}
public function submit($title, $filePath = null, $content = null, $plan = 'basic') {
try {
$multipart = [
['name' => 'title', 'contents' => $title],
['name' => 'plan', 'contents' => $plan]
];
if ($filePath && file_exists($filePath)) {
$multipart[] = [
'name' => 'type',
'contents' => 'file'
];
$multipart[] = [
'name' => 'file',
'contents' => fopen($filePath, 'r'),
'filename' => basename($filePath)
];
} elseif ($content) {
$multipart[] = [
'name' => 'type',
'contents' => 'text'
];
$multipart[] = [
'name' => 'content',
'contents' => $content
];
} else {
throw new Exception('Either file path or content must be provided');
}
$response = $this->client->post('submit', [
'multipart' => $multipart
]);
return json_decode($response->getBody(), true);
} catch (RequestException $e) {
throw new Exception('API Error: ' . $e->getMessage());
}
}
public function verify($certificateId) {
try {
$response = $this->client->get('verify/' . $certificateId);
return json_decode($response->getBody(), true);
} catch (RequestException $e) {
throw new Exception('Verification Error: ' . $e->getMessage());
}
}
public function getStatus($certificateId) {
try {
$response = $this->client->get('status/' . $certificateId);
return json_decode($response->getBody(), true);
} catch (RequestException $e) {
throw new Exception('Status Error: ' . $e->getMessage());
}
}
}
// Usage Example
$client = new MyCognitorClient('YOUR_API_KEY');
// Submit a file
$result = $client->submit('My Innovation', 'document.pdf', null, 'standard');
echo "Certificate ID: " . $result['data']['certificate_id'] . "\n";
// Submit text content
$textResult = $client->submit('My Idea', null, 'This is my innovative concept...', 'basic');
echo "Text Certificate ID: " . $textResult['data']['certificate_id'] . "\n";
// Verify a certificate
$verification = $client->verify('CERT-2025-ABC12345');
echo "Valid: " . ($verification['data']['status'] === 'valid' ? 'Yes' : 'No') . "\n";
?><?php
try {
$result = $client->submit('My Innovation', 'document.pdf');
if ($result['success']) {
echo "Success! Certificate ID: " . $result['data']['certificate_id'];
echo "\nDownload URL: " . $result['data']['certificate_url'];
echo "\nVerification URL: " . $result['data']['verification_url'];
} else {
echo "Error: " . $result['message'];
}
} catch (Exception $e) {
echo "Exception: " . $e->getMessage();
// Log error for debugging
error_log("myCognitor API Error: " . $e->getMessage());
}
?><?php
// Submit with AI Advisory
$result = $client->submit(
'My Business Idea',
null,
'Revolutionary blockchain-based solution...',
'professional'
);
// Add AI Advisory (additional $5)
$multipart = [
['name' => 'title', 'contents' => 'My Innovation'],
['name' => 'type', 'contents' => 'text'],
['name' => 'content', 'contents' => 'My innovative concept...'],
['name' => 'plan', 'contents' => 'standard'],
['name' => 'ai_advisory', 'contents' => 'true'] // Enable AI analysis
];
$response = $client->post('submit', ['multipart' => $multipart]);
$result = json_decode($response->getBody(), true);
if ($result['success']) {
echo "Certificate: " . $result['data']['certificate_id'] . "\n";
echo "AI Analysis: " . $result['data']['ai_analysis'] . "\n";
}
?>