@idiomark/adapter-stackexchange
Stack Exchange adapter for Idiomark (Personality Compression Protocol). Extracts user personality data from Stack Exchange network (Stack Overflow, Super User, etc.) including questions, answers, comments, and reputation.
Features
- User Profile: Reputation, badges, account stats
- Questions: Titles, descriptions, tags, votes, answers
- Answers: Code solutions, explanations, acceptance status
- Comments: Technical discussions and clarifications
Authentication
Uses API Key or OAuth 2.0 authentication.
import { StackExchangeAdapter } from '@idiomark/adapter-stackexchange'
const adapter = new StackExchangeAdapter({
apiKey: 'your_api_key', // optional
accessToken: 'your_access_token', // optional
accountId: 'user_account_id',
site: 'stackoverflow' // default, supports all 170+ sites
})
await adapter.authenticate()
Rate Limits
Stack Exchange enforces quota limits:
- 300 requests per day (IP-based)
- Higher limits for authenticated apps with access token
The adapter tracks quota and warns when approaching limits.
Usage
// Fetch all user data
const content = await adapter.fetchData({
limit: 100,
startDate: new Date('2024-01-01'),
endDate: new Date('2024-12-31'),
includeReplies: true
})
// Extract raw text for analysis
const { rawContent, metadata } = await adapter.extractRawText({ limit: 100 })
Data Types
| Type | Description |
|---|---|
profile | User reputation, badges, and stats |
question | Questions with tags, votes, and answers |
answer | Answers with code, acceptance status |
comment | Technical comments and discussions |
Supported Sites
This adapter works with all 170+ Stack Exchange sites:
- Stack Overflow
- Super User
- Server Fault
- Mathematics
- Physics
- And 160+ more
API Documentation
License
MIT