The Veritas.dev API provides automated documentation-code verification capabilities through a RESTful interface.
Base URL: http://localhost:8000/api/v1
Authentication: API key-based (coming soon)
Check if the API is running.
Response:
{
"status": "healthy",
"timestamp": "2024-01-17T19:39:00.000Z",
"service": "Veritas.dev API"
}Get detailed system status.
Response:
{
"status": "operational",
"version": "1.0.0",
"timestamp": "2024-01-17T19:39:00.000Z",
"components": {
"api": "healthy",
"detection_engine": "ready",
"integrations": "configured"
}
}Analyze code and documentation for discrepancies.
Request Body:
{
"code_url": "https://github.com/user/repo",
"doc_url": "https://docs.example.com",
"code_content": "def hello():\n pass",
"doc_content": "# Documentation\n...",
"language": "python"
}Parameters:
code_url(string, optional): URL to code repositorydoc_url(string, optional): URL to documentationcode_content(string, optional): Raw code contentdoc_content(string, optional): Raw documentation contentlanguage(string, default: "python"): Programming language
Response:
{
"status": "success",
"discrepancies": [
{
"type": "missing_documentation",
"severity": "medium",
"location": "file.py:42",
"description": "Function 'calculate' is not documented",
"code_snippet": "def calculate(x, y):",
"doc_snippet": null,
"suggestion": "Add documentation for function 'calculate'"
}
],
"summary": "Found 1 discrepancy",
"timestamp": "2024-01-17T19:39:00.000Z",
"metadata": {
"files_analyzed": 5,
"functions_checked": 23
}
}Upload files for analysis.
Request:
- Content-Type:
multipart/form-data code_file(file, required): Source code filedoc_file(file, optional): Documentation file
Response:
Same as /analyze endpoint
Enumeration of discrepancy types:
function_signature- Function signature mismatchparameter_type- Parameter type inconsistencyreturn_type- Return type mismatchmissing_documentation- Missing documentationoutdated_example- Outdated code exampledeprecated_usage- Deprecated function usage
low- Minor issue, cosmeticmedium- Should be addressedhigh- Important, affects usabilitycritical- Must be fixed, breaks functionality
{
"detail": "Invalid request parameters"
}{
"detail": "Analysis failed: [error message]"
}- Free tier: 100 requests/hour
- Pro tier: 1000 requests/hour
- Enterprise: Unlimited
import requests
url = "http://localhost:8000/api/v1/analyze"
data = {
"code_content": "def add(a, b):\n return a + b",
"doc_content": "# add(x, y)\nAdds two numbers",
"language": "python"
}
response = requests.post(url, json=data)
result = response.json()
print(f"Found {len(result['discrepancies'])} discrepancies")const response = await fetch('http://localhost:8000/api/v1/analyze', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
code_content: 'function add(a, b) { return a + b; }',
doc_content: '# add(x, y)\nAdds two numbers',
language: 'javascript'
})
});
const result = await response.json();
console.log(`Found ${result.discrepancies.length} discrepancies`);curl -X POST http://localhost:8000/api/v1/analyze \
-H "Content-Type: application/json" \
-d '{
"code_content": "def multiply(a, b):\n return a * b",
"doc_content": "# multiply(x, y)\nMultiplies two numbers",
"language": "python"
}'For interactive API exploration:
- Swagger UI: http://localhost:8000/api/docs
- ReDoc: http://localhost:8000/api/redoc
- Initial release
- Basic analysis endpoints
- Python code parsing
- Markdown documentation parsing
- Multi-language support foundation