API Documentation

Comprehensive guide to integrating with the VisiSocial API

Version 2.0.0

Introduction

Welcome to the VisiSocial API documentation. Our API allows you to programmatically access personality analysis, user insights, and data export features. All endpoints use REST principles and return JSON responses.

Base URL

All API requests should be made to: https://api.visisocial.com/v2

Quick Start

Authentication

All API requests require authentication using an access token. Include your token in the Authorization header of each request.

Getting Your API Token

You can generate an API token from your dashboard settings. Navigate to Settings → API → Generate New Token.

HTTP Request
GET /api/profile HTTP/1.1
Host: api.visisocial.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

Security Warning

Never expose your API token in client-side code or public repositories. Tokens should only be used in server-side applications.

Rate Limits

API requests are rate limited to ensure fair usage and system stability. Current rate limits:

Endpoint Type Rate Limit Window
Standard Endpoints 100 requests Per hour
Analysis Endpoints 10 requests Per hour
Export Endpoints 5 requests Per hour

Rate Limit Headers

Each response includes rate limit information in the headers:

HTTP Response Headers
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1704067200

Error Handling

The API uses standard HTTP status codes and returns detailed error messages in JSON format.

Error Response Format

JSON Response
{
  "success": false,
  "error": "UNAUTHORIZED",
  "message": "Authentication required",
  "details": {
    "timestamp": "2026-01-01T12:00:00Z",
    "path": "/api/profile"
  }
}

Common Error Codes

Status Code Error Code Description
400 BAD_REQUEST Invalid request parameters
401 UNAUTHORIZED Missing or invalid authentication
403 FORBIDDEN Insufficient permissions
404 NOT_FOUND Resource not found
429 RATE_LIMIT Rate limit exceeded

User Profile

Retrieve and update user profile information.

GET /api/profile

Retrieves the authenticated user's profile information including basic details and preferences.

Response

200 OK
JSON Response
{
  "success": true,
  "user": {
    "id": "12345678",
    "name": "John Doe",
    "email": "john@example.com",
    "picture": "https://...",
    "gender": "male",
    "location": "San Francisco, CA",
    "createdAt": "2025-01-01T00:00:00Z",
    "lastUpdated": "2026-01-01T12:00:00Z"
  }
}
PUT /api/profile

Update user profile settings and preferences.

Request Parameters

Parameter Type Description
displayName optional string Updated display name
preferences optional object User preferences object
Request Body
{
  "displayName": "John D.",
  "preferences": {
    "theme": "dark",
    "notifications": true
  }
}

Personality Analysis

Access personality analysis results and trigger new analyses.

GET /api/analysis/personality

Retrieves the user's personality analysis based on the Big Five model.

JSON Response
{
  "success": true,
  "personality": {
    "scores": {
      "openness": 75,
      "conscientiousness": 68,
      "extroversion": 82,
      "agreeableness": 71,
      "neuroticism": 45,
      "confidence": 87
    },
    "description": "You tend to be outgoing and social...",
    "lastUpdated": "2026-01-01T12:00:00Z"
  }
}
POST /api/analysis/personality/refresh

Triggers a new personality analysis based on the latest user data.

Asynchronous Processing

This endpoint returns immediately with a task ID. Use the task status endpoint to check progress.

JSON Response
{
  "success": true,
  "taskId": "task_abc123",
  "message": "Analysis started"
}

Insights & Recommendations

Access AI-generated insights and personalized recommendations.

GET /api/analysis/insights

Retrieves personalized insights and recommendations based on user data.

JSON Response
{
  "success": true,
  "insights": {
    "personality": [
      {
        "title": "Social Energy",
        "description": "You draw energy from social interactions..."
      }
    ],
    "recommendations": [
      {
        "title": "Explore Team Activities",
        "description": "Based on your extroversion score..."
      }
    ],
    "trends": []
  }
}

Data Export

Export user data in various formats.

GET /api/export/json

Exports all user data as JSON. Returns a downloadable file.

GET /api/export/pdf

Generates and exports a comprehensive PDF report of personality analysis.

SDKs & Libraries

Official SDKs and community libraries to simplify API integration.

Code Examples

JavaScript / Node.js

JavaScript
const axios = require('axios');

const API_TOKEN = 'your_api_token';
const BASE_URL = 'https://api.visisocial.com/v2';

async function getProfile() {
  try {
    const response = await axios.get(`${BASE_URL}/api/profile`, {
      headers: {
        'Authorization': `Bearer ${API_TOKEN}`,
        'Content-Type': 'application/json'
      }
    });
    
    console.log('User Profile:', response.data);
    return response.data;
  } catch (error) {
    console.error('Error:', error.response?.data || error.message);
  }
}

getProfile();

Python

Python
import requests

API_TOKEN = 'your_api_token'
BASE_URL = 'https://api.visisocial.com/v2'

def get_profile():
    headers = {
        'Authorization': f'Bearer {API_TOKEN}',
        'Content-Type': 'application/json'
    }
    
    response = requests.get(f'{BASE_URL}/api/profile', headers=headers)
    
    if response.status_code == 200:
        print('User Profile:', response.json())
        return response.json()
    else:
        print('Error:', response.json())
        return None

get_profile()

cURL

Bash
curl -X GET https://api.visisocial.com/v2/api/profile \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Changelog

Version 2.0.0 (2026-01-01)

  • Added: New insights endpoint with AI-generated recommendations
  • Improved: Enhanced personality analysis accuracy
  • Changed: Updated rate limits for analysis endpoints
  • Deprecated: Legacy v1 endpoints (sunset date: 2026-06-01)