Logo Mopsos AIMopsos AI

API Documentation

Welcome to the Mopsos AI API documentation. This page provides detailed information on how to use the endpoints of our API to retrieve data for your projects. The API is designed to give you access to key metrics about the projects you are analyzing.

Base URL
https://api.mopsos.ai/
Endpoints
We currently provide two main endpoints

1. /project_id

Method: GET

This endpoint returns the list of project IDs available in the Mopsos AI database. You can use these IDs to query specific project data from the /data endpoint.

Request Parameters:

  • api-key / x-api-key (query parameter or header): Your valid API key.

Example Request:

GET https://api.mopsos.ai/project_id?api-key=your_api_key

Example Response:

["project_1", "project_2", "project_3"]

2. /data

Method: GET

This endpoint allows you to retrieve data for a specific project. You can filter the data by project ID, start date, and end date.

Request Parameters:

  • api-key / x-api-key (query parameter or header): Your valid API key.
  • project_id (required): The unique ID of the project.
  • start_date (optional): The start date in ISO 8601 format (YYYY-MM-DD).
  • end_date (optional): The end date in ISO 8601 format (YYYY-MM-DD).

Example Request:

GET https://api.mopsos.ai/data?project_id=project_1&start_date=2024-01-01&end_date=2024-01-31&api-key=your_api_key

Example Response:

[
  {
    "date": "2024-01-01",
    "twitter_post": 120,
    "twitter_user": 100,
    "discord_message": 50,
    "telegram_message": 30,
    "wikipedia_view": 200,
    "opening_price": 10.5,
    "closing_price": 11.0
  },
  {
    "date": "2024-01-02",
    "twitter_post": 110,
    "twitter_user": 95,
    "discord_message": 60,
    "telegram_message": 25,
    "wikipedia_view": 180,
    "opening_price": 11.0,
    "closing_price": 10.8
  }
]
API Key Authentication

To interact with the API, you must include a valid API key in either the query parameter api-key or the request header x-api-key. You can obtain an API key by visiting our API page.

If the provided API key is invalid or expired, the API will respond with an error message and a status code 401 (Unauthorized).

Code Example
Here's an example of how to make a request to the /data endpoint using Python
import requests

url = "https://api.mopsos.ai/data"
headers = {
    "x-api-key": "your_api_key"
}
params = {
    "project_id": "project_1",
    "start_date": "2024-01-01",
    "end_date": "2024-01-31"
}

response = requests.get(url, headers=headers, params=params)
data = response.json()

print(data)
Support & Feedback

If you encounter any issues or need further assistance, feel free to contact our support team via our dedicated discord channel #api-support.