Loading...
Loading...
Integrate Hollow Knight: Silksong data into your applications with our comprehensive REST API. Get real-time game status, manage subscriptions, and access timeline data.
// Quick Start - Get Game Status
fetch('https://silksong-nextjs.vercel.app/api/status')
.then(response => response.json())
.then(data => {
console.log('Days until release:', data.daysRemaining);
console.log('Latest updates:', data.timelineItems.slice(0, 5));
})
.catch(error => console.error('Error:', error));
You'll get a comprehensive response with:
All API endpoints are relative to this base URL.
Currently, all endpoints are public and don't require authentication. Rate limits apply to ensure fair usage.
Complete documentation for all available endpoints
/api/status
// Basic request
fetch('https://silksong-nextjs.vercel.app/api/status')
.then(response => response.json())
.then(data => console.log(data));
// With caching support
const headers = {};
if (localStorage.getItem('status-etag')) {
headers['If-None-Match'] = localStorage.getItem('status-etag');
}
fetch('https://silksong-nextjs.vercel.app/api/status', { headers })
.then(response => {
if (response.status === 304) {
// Use cached data
return JSON.parse(localStorage.getItem('status-data'));
}
// Store new ETag
localStorage.setItem('status-etag', response.headers.get('ETag'));
return response.json();
})
.then(data => {
localStorage.setItem('status-data', JSON.stringify(data));
console.log(data);
});
{
"error": "Please enter a valid email address",
"code": "VALIDATION_ERROR",
"details": {
"field": "email",
"provided": "invalid-email"
},
"timestamp": "2024-08-24T10:30:45.123Z",
"path": "/api/subscribe"
}
async function handleApiCall(url, options = {}) {
try {
const response = await fetch(url, options);
// Handle rate limiting
if (response.status === 429) {
const resetTime = response.headers.get('X-RateLimit-Reset');
const waitTime = (resetTime * 1000) - Date.now();
console.log(`Rate limited. Retry after ${Math.ceil(waitTime / 1000)} seconds`);
// Implement exponential backoff
await new Promise(resolve => setTimeout(resolve, waitTime));
return handleApiCall(url, options); // Retry
}
// Handle not modified (use cache)
if (response.status === 304) {
return getCachedData(url);
}
// Parse response
const data = await response.json();
// Handle errors
if (!response.ok) {
throw new Error(`API Error (${response.status}): ${data.error}`);
}
// Cache successful response
setCachedData(url, data, response.headers.get('ETag'));
return data;
} catch (error) {
console.error('API call failed:', error);
throw error;
}
}
Join the developer community and get help when you need it
Contribute, report issues, and view source code
View RepositoryJoin the developer community chat
Join ServerCommunity-built integrations and examples
Browse ExamplesOfficial and community SDK libraries
View SDKsOfficial TypeScript SDK with full type safety and caching support.
npm install silksong-api
React hooks for easy integration in React applications.
npm install @silksong/react-hooks
Official Python SDK with async support and automatic retry logic.
pip install silksong-api
Command-line tool for monitoring and notifications.
pip install silksong-cli
import { SilksongAPI } from 'silksong-api';
// Initialize client
const api = new SilksongAPI({
baseUrl: 'https://silksong-nextjs.vercel.app',
cache: true, // Enable automatic caching
retries: 3 // Automatic retry on failures
});
// Get game status with full TypeScript support
const status = await api.getStatus();
console.log(`${status.daysRemaining} days remaining!`);
// Subscribe to updates with validation
try {
const result = await api.subscribe('user@example.com');
console.log('Subscribed successfully!', result.subscription.id);
} catch (error) {
if (error.code === 'ALREADY_SUBSCRIBED') {
console.log('Email already subscribed');
}
}
// Get RSS feed as structured data
const feed = await api.getRSSFeed();
console.log('Latest updates:', feed.items.slice(0, 5));