The research system now provides API endpoints that return data in both JSON and Markdown formats, making it usable as a database for Ontic developers.
JSON Format (default):
GET /api/research
GET /api/research?format=json
Returns:
{
"total": 3,
"posts": [
{
"id": "ambient-intelligence",
"title": "Building Ambient Intelligence",
"date": "FEBRUARY 14, 2026",
"category": "ENGINEERING",
"description": "An architectural overview...",
"url": "/api/research/ambient-intelligence",
"jsonUrl": "/research/ambient-intelligence.json"
},
...
]
}Markdown Format:
GET /api/research?format=markdown
GET /api/research?format=md
Returns a markdown document with all posts listed with their metadata.
GET /api/research/[id]
Example:
GET /api/research/ambient-intelligence
Returns:
---
id: ambient-intelligence
title: Building Ambient Intelligence
date: FEBRUARY 14, 2026
category: ENGINEERING
description: An architectural overview of building systems...
---
# Building Ambient Intelligence
**Category:** ENGINEERING
**Date:** FEBRUARY 14, 2026
An architectural overview of building systems that run continuously...
---
## What is Ambient Intelligence?
Ambient intelligence refers to systems that operate seamlessly...GET /research/[id].json
Example:
GET /research/ambient-intelligence.json
Returns the raw JSON file.
const response = await fetch('/api/research');
const data = await response.json();
console.log(data.posts);const response = await fetch('/api/research?format=markdown');
const markdown = await response.text();
console.log(markdown);const response = await fetch('/api/research/ambient-intelligence');
const markdown = await response.text();
console.log(markdown);cURL example:
# Get all posts as JSON
curl https://your-domain.vercel.app/api/research
# Get all posts as Markdown
curl https://your-domain.vercel.app/api/research?format=markdown
# Get specific post as Markdown
curl https://your-domain.vercel.app/api/research/ambient-intelligence
# Get specific post as JSON
curl https://your-domain.vercel.app/research/ambient-intelligence.jsonPowerShell example:
# Get all posts as JSON
Invoke-RestMethod -Uri "https://your-domain.vercel.app/api/research"
# Get specific post as Markdown
Invoke-WebRequest -Uri "https://your-domain.vercel.app/api/research/ambient-intelligence" | Select-Object -ExpandProperty Content- Documentation Integration: Import research posts into documentation sites
- CI/CD Pipelines: Fetch latest research for automated reports
- Developer Tools: Build tools that reference research posts
- Knowledge Base: Use as a queryable knowledge database
- AI/LLM Context: Feed research posts to AI models for context
- Static Site Generation: Pull research data for static site builds
Content-Type: text/markdown; charset=utf-8Content-Disposition: inline; filename="[id].md"
Content-Type: application/json
{
"error": "Post not found"
}{
"error": "Invalid post ID"
}{
"error": "Failed to load research post"
}import { useEffect, useState } from 'react';
function ResearchList() {
const [posts, setPosts] = useState([]);
useEffect(() => {
fetch('/api/research')
.then(res => res.json())
.then(data => setPosts(data.posts));
}, []);
return (
<div>
{posts.map(post => (
<div key={post.id}>
<h3>{post.title}</h3>
<p>{post.description}</p>
<a href={post.url}>Read Markdown</a>
</div>
))}
</div>
);
}const fetch = require('node-fetch');
async function getResearchPosts() {
const response = await fetch('https://your-domain.vercel.app/api/research');
const data = await response.json();
for (const post of data.posts) {
console.log(`${post.title} (${post.category})`);
// Get full markdown content
const mdResponse = await fetch(`https://your-domain.vercel.app${post.url}`);
const markdown = await mdResponse.text();
// Save to file or process
console.log(markdown.substring(0, 200) + '...');
}
}
getResearchPosts();import requests
# Get all posts
response = requests.get('https://your-domain.vercel.app/api/research')
data = response.json()
for post in data['posts']:
print(f"{post['title']} ({post['category']})")
# Get markdown content
md_response = requests.get(f"https://your-domain.vercel.app{post['url']}")
markdown = md_response.text
# Save to file
with open(f"{post['id']}.md", 'w', encoding='utf-8') as f:
f.write(markdown)When running locally (http://localhost:5174), the API endpoints are also available:
http://localhost:5174/api/research
http://localhost:5174/api/research?format=markdown
http://localhost:5174/api/research/ambient-intelligence
http://localhost:5174/research/ambient-intelligence.json
- All markdown responses use UTF-8 encoding
- View counts are tracked client-side in localStorage
- The markdown format includes YAML frontmatter for metadata
- Posts are automatically sorted by date (newest first)
- The API reads directly from the filesystem (
/public/research/)