Obtenir une clé →

API Platform

Analyses algorithmiques temps réel pour LuckyJet et RocketQueen. Analysez le marché, récupérez les signaux et intégrez dans votre application en quelques lignes.

Developer quickstart

Obtenez votre première analyse en moins de 2 minutes. Créez votre compte, générez une clé et faites votre premier appel.

Commencer →
javascript
const market = await fetch(
  'https://allpredictor.com/api/v1/luckyjet/market',
  { headers: { 'X-API-Key': process.env.ALLPREDICTOR_KEY } }
).then(r => r.json());

if (market.level !== 'danger') {
  const pred = await fetch(
    'https://allpredictor.com/api/v1/luckyjet/predict',
    { headers: { 'X-API-Key': process.env.ALLPREDICTOR_KEY } }
  ).then(r => r.json());
  console.log(`✅ Cible : ${pred.predicted_coef}x`);
}
Base URL https://allpredictor.com/api/v1 Production
⚠️
Système probabiliste. Les analyses sont fondées sur des analyses statistiques et ne garantissent pas le résultat. +18 ans uniquement.
Demo

API, Bot Builder & Jeux

Découvrez en vidéo les possibilités de l'API AllPredictor.

Démarrage

Démarrage rapide

Trois étapes pour votre première analyse.

1
Créer un compte
Rendez-vous sur allpredictor.com/auth et créez votre compte développeur gratuitement.
2
Générer une clé API
Dashboard → Mes clés API → Nouvelle clé. La clé ne s'affiche qu'une fois — copiez-la immédiatement.
3
Faire votre première requête
Passez la clé dans le header X-API-Key. Commencez par /market pour vérifier les conditions avant /predict.
# 1. Vérifier le marché
curl https://allpredictor.com/api/v1/luckyjet/market -H "X-API-Key: ap_votre_clé"

# 2. Récupérer la analyse si marché safe/warn
curl https://allpredictor.com/api/v1/luckyjet/predict -H "X-API-Key: ap_votre_clé"
const BASE = 'https://allpredictor.com/api/v1';
const HEADERS = { 'X-API-Key': process.env.ALLPREDICTOR_KEY };

const market = await fetch(`${BASE}/luckyjet/market`,
  { headers: HEADERS }).then(r => r.json());

if (market.level !== 'danger') {
  const pred = await fetch(`${BASE}/luckyjet/predict`,
    { headers: HEADERS }).then(r => r.json());
  console.log(`✅ Cible : ${pred.predicted_coef}x à ${pred.bet_time}`);
}
import axios from 'axios';

const api = axios.create({
  baseURL: 'https://allpredictor.com/api/v1',
  headers: { 'X-API-Key': process.env.ALLPREDICTOR_KEY },
  timeout: 5000,
});

const { data: market } = await api.get('/luckyjet/market');
if (market.level !== 'danger') {
  const { data: pred } = await api.get('/luckyjet/predict');
  console.log(pred.predicted_coef, pred.signal);
}
function apGet($path) {
  $ch = curl_init();
  curl_setopt_array($ch, [
    CURLOPT_URL            => "https://allpredictor.com/api/v1{$path}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['X-API-Key: ap_votre_clé'],
    CURLOPT_TIMEOUT        => 5,
  ]);
  $data = json_decode(curl_exec($ch), true);
  curl_close($ch);
  return $data;
}

$market = apGet('/luckyjet/market');
if ($market['level'] !== 'danger') {
  $pred = apGet('/luckyjet/predict');
  echo "Cible : {$pred['predicted_coef']}x\n";
}
import requests

BASE = "https://allpredictor.com/api/v1"
HDR  = {"X-API-Key": "ap_votre_clé"}

market = requests.get(f"{BASE}/luckyjet/market",
    headers=HDR, timeout=5).json()

if market["level"] != "danger":
    pred = requests.get(f"{BASE}/luckyjet/predict",
        headers=HDR, timeout=5).json()
    print(f"Cible : {pred['predicted_coef']}x")
import 'package:dio/dio.dart';

final dio = Dio(BaseOptions(
  baseUrl: 'https://allpredictor.com/api/v1',
  headers: {'X-API-Key': 'ap_votre_clé'},
  connectTimeout: const Duration(seconds: 5),
));

final market = (await dio.get('/luckyjet/market')).data;
if (market['level'] != 'danger') {
  final pred = (await dio.get('/luckyjet/predict')).data;
  print('Cible : \${pred["predicted_coef"]}x');
}
import 'dart:convert';
import 'package:http/http.dart' as http;

final headers = {'X-API-Key': 'ap_votre_clé'};
final base = 'https://allpredictor.com/api/v1';

final mRes = await http.get(Uri.parse('$base/luckyjet/market'), headers: headers);
final market = jsonDecode(mRes.body);

if (market['level'] != 'danger') {
  final pRes = await http.get(Uri.parse('$base/luckyjet/predict'), headers: headers);
  final pred = jsonDecode(pRes.body);
  print('Cible : \${pred["predicted_coef"]}x');
}
require 'net/http'
require 'json'

def ap_get(path)
  uri = URI("https://allpredictor.com/api/v1#{path}")
  req = Net::HTTP::Get.new(uri)
  req['X-API-Key'] = 'ap_votre_clé'
  res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
  JSON.parse(res.body)
end

market = ap_get('/luckyjet/market')
if market['level'] != 'danger'
  pred = ap_get('/luckyjet/predict')
  puts "Cible : #{pred['predicted_coef']}x"
end
package main

import (
  "encoding/json"; "fmt"; "io"; "net/http"; "time"
)

var client = &http.Client{Timeout: 5 * time.Second}

func apGet(path string) map[string]any {
  req, _ := http.NewRequest("GET",
    "https://allpredictor.com/api/v1"+path, nil)
  req.Header.Set("X-API-Key", "ap_votre_clé")
  res, _ := client.Do(req)
  defer res.Body.Close()
  b, _ := io.ReadAll(res.Body)
  var d map[string]any
  json.Unmarshal(b, &d)
  return d
}

func main() {
  m := apGet("/luckyjet/market")
  if m["level"] != "danger" {
    p := apGet("/luckyjet/predict")
    fmt.Println("Cible :", p["predicted_coef"])
  }
}
import okhttp3.*
import org.json.JSONObject

val client = OkHttpClient.Builder()
  .callTimeout(5, java.util.concurrent.TimeUnit.SECONDS).build()

fun apGet(path: String): JSONObject {
  val req = Request.Builder()
    .url("https://allpredictor.com/api/v1$path")
    .addHeader("X-API-Key", "ap_votre_clé").build()
  return JSONObject(client.newCall(req).execute().body?.string()!!)
}

fun main() {
  val market = apGet("/luckyjet/market")
  if (market.getString("level") != "danger") {
    val pred = apGet("/luckyjet/predict")
    println("Cible : ${pred.getDouble("predicted_coef")}x")
  }
}
import Foundation

func apGet(_ path: String) async throws -> [String: Any] {
  var req = URLRequest(url: URL(string:
    "https://allpredictor.com/api/v1\(path)")!)
  req.setValue("ap_votre_clé", forHTTPHeaderField: "X-API-Key")
  req.timeoutInterval = 5
  let (data, _) = try await URLSession.shared.data(for: req)
  return try JSONSerialization.jsonObject(with: data) as! [String: Any]
}

let market = try await apGet("/luckyjet/market")
if market["level"] as? String != "danger" {
  let pred = try await apGet("/luckyjet/predict")
  print("Cible : \(pred["predicted_coef"]!)x")
}
const https = require('https');

function apGet(path) {
  return new Promise((resolve, reject) => {
    const req = https.request({
      hostname: 'allpredictor.com',
      path: `/api/v1${path}`,
      headers: { 'X-API-Key': process.env.ALLPREDICTOR_KEY },
    }, res => {
      let body = '';
      res.on('data', d => body += d);
      res.on('end', () => resolve(JSON.parse(body)));
    });
    req.on('error', reject);
    req.end();
  });
}

const market = await apGet('/luckyjet/market');
if (market.level !== 'danger') {
  const pred = await apGet('/luckyjet/predict');
  console.log(`Cible : ${pred.predicted_coef}x`);
}
Authentification

Clé API — X-API-Key

Toutes les requêtes nécessitent votre clé API dans le header HTTP X-API-Key. Sans clé valide, l'API retourne immédiatement un 401 Unauthorized.

Propriété Valeur
Header X-API-Key
Préfixe ap_
Longueur 50 caractères
Exemple ap_a3f8b2c1d4e5f607891a2b3c4d5e6f7a8b9c0d1
🔒
Sécurité : ne codez jamais la clé en dur. Utilisez des variables d'environnement (process.env.ALLPREDICTOR_KEY). Une clé par environnement (dev/staging/prod) pour permettre la révocation ciblée.
curl https://allpredictor.com/api/v1/luckyjet/predict \
  -H "X-API-Key: ap_votre_clé"
const headers = { 'X-API-Key': process.env.ALLPREDICTOR_KEY };
const res = await fetch(url, { headers });
if (res.status === 401)
  throw new Error('Clé invalide — vérifiez votre dashboard');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: ap_votre_clé']);
headers = {"X-API-Key": "ap_votre_clé"}
response = requests.get(url, headers=headers, timeout=5)
response.raise_for_status()
Options(headers: {'X-API-Key': 'ap_votre_clé'})
req.Header.Set("X-API-Key", "ap_votre_clé")
LuckyJet

Analyse en temps réel

GEThttps://allpredictor.com/api/v1/luckyjet/predict

Retourne la analyse courante générée par le moteur algorithmique. Mettez en cache 30–60 s côté client via generated_at.

Champs de la réponse

Champ Type Plage Description
predicted_coef float ≥ 1.01 Encaissez avant que le jeu atteigne ce multiplicateur.
confidence integer 0–100 Score de confiance. <60 = peu fiable.
signal enum safe / warn / danger
bet_time string HH:MM Heure locale optimale.
market_score integer 0–100 Score synthétique du marché.
avg_recent_coef float Moyenne des 8 derniers rounds.
generated_at datetime ISO 8601 UTC Timestamp de génération — base du cache.

Signaux de marché

safe
market_score ≥ 70
Conditions favorables.
warn
30 ≤ score < 70
Réduire la mise.
danger
score < 30
Ne pas miser.
curl -X GET "https://allpredictor.com/api/v1/luckyjet/predict" \
  -H "X-API-Key: ap_votre_clé"
const res = await fetch('https://allpredictor.com/api/v1/luckyjet/predict',
  { headers: { 'X-API-Key': process.env.ALLPREDICTOR_KEY } });
const data = await res.json();
if (data.signal === 'safe' && data.confidence >= 70)
  console.log(`✅ Cible : ${data.predicted_coef}x à ${data.bet_time}`);
const { data } = await axios.get('/luckyjet/predict');
console.log(data.predicted_coef, data.signal);
$data = apGet('/luckyjet/predict');
echo "Signal: {$data['signal']} | Cible: {$data['predicted_coef']}x\n";
data = requests.get(
    "https://allpredictor.com/api/v1/luckyjet/predict",
    headers={"X-API-Key": "ap_votre_clé"}, timeout=5
).json()
print(f"Signal: {data['signal']} | Cible: {data['predicted_coef']}x")
final res = (await dio.get('/luckyjet/predict')).data;
print('Cible : \${res["predicted_coef"]}x');
final res = await http.get(
  Uri.parse('https://allpredictor.com/api/v1/luckyjet/predict'),
  headers: {'X-API-Key': 'ap_votre_clé'},
);
final data = jsonDecode(res.body);
data = ap_get('/luckyjet/predict')
puts "Cible : #{data['predicted_coef']}x"
p := apGet("/luckyjet/predict")
fmt.Println(p["predicted_coef"], p["signal"])
val pred = apGet("/luckyjet/predict")
println(pred.getString("signal"))
let pred = try await apGet("/luckyjet/predict")
print(pred["predicted_coef"]!, pred["signal"]!)
const pred = await apGet('/luckyjet/predict');
console.log(pred.predicted_coef, pred.signal);
Réponse 200 — OK
200 OKSignal safe
{
  "success": true,
  "predicted_coef": 2.45,
  "confidence": 87,
  "bet_time": "14:32",
  "market_score": 82,
  "signal": "safe",
  "avg_recent_coef": 2.31,
  "plan": "free",
  "generated_at": "2025-03-15T14:30:00.000Z"
}
LuckyJet

Analyse du marché

GET…/api/v1/luckyjet/market

État courant du marché. À appeler avant /predict.

Champ Type Description
score integer 0–100 Score synthétique. Hausse sur tendance positive, chute sur pertes consécutives.
level enum safe ≥70 · warn 30–69 · danger <30
reason string Explication naturelle affichable à l'utilisateur.
consecutive_losses integer Pertes consécutives. ≥2 = pause recommandée.
avg_coef float Coefficient moyen des derniers rounds.
trend float Tendance : positif = haussier, négatif = baissier.
curl https://allpredictor.com/api/v1/luckyjet/market -H "X-API-Key: ap_votre_clé"
const m = await fetch('https://allpredictor.com/api/v1/luckyjet/market',{headers:{'X-API-Key':process.env.ALLPREDICTOR_KEY}}).then(r=>r.json());
$m = apGet('/luckyjet/market');
m = requests.get("https://allpredictor.com/api/v1/luckyjet/market",headers={"X-API-Key":"ap_votre_clé"}).json()
final m = (await dio.get('/luckyjet/market')).data;
m := apGet("/luckyjet/market")
Réponse 200
200 OKMarché favorable
{ "success":true, "score":82, "level":"safe", "reason":"Marché favorable", "consecutive_losses":0, "avg_coef":2.87, "trend":0.42, "plan":"free" }
LuckyJet

Historique des analyses

GET…/api/v1/luckyjet/history

Analyses passées avec coefficient réel constaté et taux de précision global.

Paramètre Type Requis Défaut Max
limit integer optionnel 50 200
curl "https://allpredictor.com/api/v1/luckyjet/history?limit=20" -H "X-API-Key: ap_votre_clé"
const { data, accuracy_percent } = await fetch('https://allpredictor.com/api/v1/luckyjet/history?limit=20',{headers:{'X-API-Key':process.env.ALLPREDICTOR_KEY}}).then(r=>r.json());
console.log(`Précision: ${accuracy_percent}%`);
$h=apGet('/luckyjet/history?limit=20'); echo "Précision: {$h['accuracy_percent']}%\n";
h = requests.get("https://allpredictor.com/api/v1/luckyjet/history",params={"limit":20},headers={"X-API-Key":"ap_votre_clé"}).json()
final h = (await dio.get('/luckyjet/history',queryParameters:{'limit':20})).data;
Réponse 200
200 OK
{ "success":true, "total":10, "accuracy_percent":87, "plan":"free", "data":[{ "predicted_coef":3.20, "real_coef":3.86, "status":"ok", "round":null, "timestamp":"2025-03-15T14:32:00Z" }] }
LuckyJet

Coefficients en temps réel

GET…/api/v1/luckyjet/coefficients

Flux des vrais coefficients des derniers rounds avec statistiques agrégées. Paramètre limit (défaut 20, max 100).

curl "https://allpredictor.com/api/v1/luckyjet/coefficients?limit=20" -H "X-API-Key: ap_votre_clé"
const{stats,data}=await fetch('https://allpredictor.com/api/v1/luckyjet/coefficients?limit=20',{headers:{'X-API-Key':process.env.ALLPREDICTOR_KEY}}).then(r=>r.json());
c=requests.get("https://allpredictor.com/api/v1/luckyjet/coefficients",params={"limit":20},headers={"X-API-Key":"ap_votre_clé"}).json()
$c=apGet('/luckyjet/coefficients?limit=20');
final c=(await dio.get('/luckyjet/coefficients',queryParameters:{'limit':20})).data;
Réponse 200
200 OK
{
  "success": true,
  "total": 20,
  "plan": "free",
  "stats": {
    "average": 2.43,
    "max": 8.12,
    "min": 1.03,
    "above_2x": 12,
    "below_1_5x": 4,
    "above_2x_pct": 60
  },
  "data": [{ "coef": 3.14 }, { "coef": 1.23 }]
}
LuckyJet — tous les jeux

Vérification du marché

GET…/api/v1/{game}/check

Analyse les 5 derniers coefficients réels du jeu. Si tous sont inférieurs à , les prédictions sont bloquées et un message d'alerte est retourné. À appeler avant /predict, en complément de /market. Fonctionne pour tous les jeux (luckyjet, rocketqueen, crash, astro, metacrash, tropicana).

⚠️
Blocage automatique. Quand blocked: true, affichez le champ message à l'utilisateur et suspendez les appels à /predict pendant quelques minutes.
Champ réponse Type Description
safe boolean Vrai si le marché est stable. Faux si blocage actif.
blocked boolean Toujours l'inverse de safe. Utilisez ce champ pour conditionner l'accès à /predict.
message string Message d'alerte prêt à l'affichage. Présent uniquement si blocked: true.
reason string Explication courte. Présent uniquement si blocked: false.
coefs float[] Les 5 derniers coefficients réels analysés.
below_threshold integer Nombre de coefficients sous le seuil de 3×. Vaut 5 quand blocked: true.
curl https://allpredictor.com/api/v1/luckyjet/check -H "X-API-Key: ap_votre_clé"
const chk = await fetch('https://allpredictor.com/api/v1/luckyjet/check',
  {headers:{'X-API-Key':process.env.ALLPREDICTOR_KEY}}).then(r=>r.json());

if (chk.blocked) {
  showAlert(chk.message); // afficher le message à l'utilisateur
} else {
  const pred = await fetch('…/luckyjet/predict', …); // prédiction autorisée
}
$chk = apGet('/luckyjet/check');
if ($chk['blocked']) {
  echo $chk['message'];
} else {
  $pred = apGet('/luckyjet/predict');
}
chk = requests.get("https://allpredictor.com/api/v1/luckyjet/check",
  headers={"X-API-Key":"ap_votre_clé"}).json()
if chk["blocked"]:
    print(chk["message"])
else:
    pred = requests.get("…/luckyjet/predict", …).json()
final chk = (await dio.get('/luckyjet/check')).data;
if (chk['blocked']) {
  showSnackbar(chk['message']);
} else {
  final pred = (await dio.get('/luckyjet/predict')).data;
}
Réponses 200
200 OKSérie de pertes — prédictions bloquées
{
  "success": true,
  "safe": false,
  "blocked": true,
  "message": "Le système a détecté une série de pertes. Veuillez réessayer dans quelques minutes.",
  "coefs": [1.2, 2.1, 1.8, 2.4, 1.5],
  "below_threshold": 5,
  "plan": "pro"
}
200 OKMarché stable — prédictions autorisées
{
  "success": true,
  "safe": true,
  "blocked": false,
  "reason": "Marché stable — prédictions autorisées",
  "coefs": [4.2, 1.1, 5.8, 2.4, 3.5],
  "below_threshold": 2,
  "plan": "pro"
}
RocketQueen

RocketQueen — 5 endpoints

🔁
Structure identique à LuckyJet. Remplacez simplement luckyjet par rocketqueen dans toutes les URLs. Schémas, paramètres et codes d'erreur strictement identiques.
GET…/api/v1/rocketqueen/predict
GET…/api/v1/rocketqueen/market
GET…/api/v1/rocketqueen/history ?limit=50
GET…/api/v1/rocketqueen/coefficients ?limit=20
GET…/api/v1/rocketqueen/check
curl https://allpredictor.com/api/v1/rocketqueen/predict -H "X-API-Key: ap_votre_clé"
curl https://allpredictor.com/api/v1/rocketqueen/market -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/rocketqueen/history?limit=50" -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/rocketqueen/coefficients?limit=20" -H "X-API-Key: ap_votre_clé"
const BASE = 'https://allpredictor.com/api/v1';
const HDR  = {'X-API-Key': process.env.ALLPREDICTOR_KEY};
const pred = await fetch(`${BASE}/rocketqueen/predict`,{headers:HDR}).then(r=>r.json());
$pred=apGet('/rocketqueen/predict');
$market=apGet('/rocketqueen/market');
pred=requests.get("https://allpredictor.com/api/v1/rocketqueen/predict",headers={"X-API-Key":"ap_votre_clé"}).json()
final pred=(await dio.get('/rocketqueen/predict')).data;
pred := apGet("/rocketqueen/predict")
Crash

Crash — 5 endpoints

🔁
Structure identique à LuckyJet. Remplacez simplement luckyjet par crash dans toutes les URLs. Schémas, paramètres et codes d'erreur strictement identiques.
GET…/api/v1/crash/predict
GET…/api/v1/crash/market
GET…/api/v1/crash/history ?limit=50
GET…/api/v1/crash/coefficients ?limit=20
GET…/api/v1/crash/check
curl https://allpredictor.com/api/v1/crash/predict -H "X-API-Key: ap_votre_clé"
curl https://allpredictor.com/api/v1/crash/market -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/crash/history?limit=50" -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/crash/coefficients?limit=20" -H "X-API-Key: ap_votre_clé"
const BASE = 'https://allpredictor.com/api/v1';
const HDR  = {'X-API-Key': process.env.ALLPREDICTOR_KEY};
const pred = await fetch(`${BASE}/crash/predict`,{headers:HDR}).then(r=>r.json());
$pred=apGet('/crash/predict');
$market=apGet('/crash/market');
pred=requests.get("https://allpredictor.com/api/v1/crash/predict",headers={"X-API-Key":"ap_votre_clé"}).json()
final pred=(await dio.get('/crash/predict')).data;
pred := apGet("/crash/predict")
Astronaut

Astronaut — 5 endpoints

🔁
Structure identique à LuckyJet. Remplacez simplement luckyjet par astronaut dans toutes les URLs. Schémas, paramètres et codes d'erreur strictement identiques.
GET…/api/v1/astronaut/predict
GET…/api/v1/astronaut/market
GET…/api/v1/astronaut/history ?limit=50
GET…/api/v1/astronaut/coefficients ?limit=20
GET…/api/v1/astronaut/check
curl https://allpredictor.com/api/v1/astronaut/predict -H "X-API-Key: ap_votre_clé"
curl https://allpredictor.com/api/v1/astronaut/market -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/astronaut/history?limit=50" -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/astronaut/coefficients?limit=20" -H "X-API-Key: ap_votre_clé"
const BASE = 'https://allpredictor.com/api/v1';
const HDR  = {'X-API-Key': process.env.ALLPREDICTOR_KEY};
const pred = await fetch(`${BASE}/astronaut/predict`,{headers:HDR}).then(r=>r.json());
$pred=apGet('/astronaut/predict');
$market=apGet('/astronaut/market');
pred=requests.get("https://allpredictor.com/api/v1/astronaut/predict",headers={"X-API-Key":"ap_votre_clé"}).json()
final pred=(await dio.get('/astronaut/predict')).data;
pred := apGet("/astronaut/predict")
Meta Crash

Meta Crash — 5 endpoints

🔁
Structure identique à LuckyJet. Remplacez simplement luckyjet par meta dans toutes les URLs. Schémas, paramètres et codes d'erreur strictement identiques.
GET…/api/v1/meta/predict
GET…/api/v1/meta/market
GET…/api/v1/meta/history ?limit=50
GET…/api/v1/meta/coefficients ?limit=20
GET…/api/v1/meta/check
curl https://allpredictor.com/api/v1/meta/predict -H "X-API-Key: ap_votre_clé"
curl https://allpredictor.com/api/v1/meta/market -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/meta/history?limit=50" -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/meta/coefficients?limit=20" -H "X-API-Key: ap_votre_clé"
const BASE = 'https://allpredictor.com/api/v1';
const HDR  = {'X-API-Key': process.env.ALLPREDICTOR_KEY};
const pred = await fetch(`${BASE}/meta/predict`,{headers:HDR}).then(r=>r.json());
$pred=apGet('/meta/predict');
$market=apGet('/meta/market');
pred=requests.get("https://allpredictor.com/api/v1/meta/predict",headers={"X-API-Key":"ap_votre_clé"}).json()
final pred=(await dio.get('/meta/predict')).data;
pred := apGet("/meta/predict")
Tropicana

Tropicana — 5 endpoints

🔁
Structure identique à LuckyJet. Remplacez simplement luckyjet par tropicana dans toutes les URLs. Schémas, paramètres et codes d'erreur strictement identiques.
GET…/api/v1/tropicana/predict
GET…/api/v1/tropicana/market
GET…/api/v1/tropicana/history ?limit=50
GET…/api/v1/tropicana/coefficients ?limit=20
GET…/api/v1/tropicana/check
curl https://allpredictor.com/api/v1/tropicana/predict -H "X-API-Key: ap_votre_clé"
curl https://allpredictor.com/api/v1/tropicana/market -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/tropicana/history?limit=50" -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/tropicana/coefficients?limit=20" -H "X-API-Key: ap_votre_clé"
const BASE = 'https://allpredictor.com/api/v1';
const HDR  = {'X-API-Key': process.env.ALLPREDICTOR_KEY};
const pred = await fetch(`${BASE}/tropicana/predict`,{headers:HDR}).then(r=>r.json());
$pred=apGet('/tropicana/predict');
$market=apGet('/tropicana/market');
pred=requests.get("https://allpredictor.com/api/v1/tropicana/predict",headers={"X-API-Key":"ap_votre_clé"}).json()
final pred=(await dio.get('/tropicana/predict')).data;
pred := apGet("/tropicana/predict")
Utilitaires

Valider une clé API

GET…/api/v1/validate-key

Vérifie si une clé est active et retourne plan et quota restant. N'incrémente pas le compteur de requêtes — appelez-la librement au démarrage de votre bot.

curl https://allpredictor.com/api/v1/validate-key -H "X-API-Key: ap_votre_clé"
const{valid,plan,requests_remaining}=await fetch('https://allpredictor.com/api/v1/validate-key',{headers:{'X-API-Key':process.env.ALLPREDICTOR_KEY}}).then(r=>r.json());
if(!valid)throw new Error('Clé invalide');
console.log(`Plan ${plan} — ${requests_remaining??'∞'} req`);
$ch=curl_init();curl_setopt_array($ch,[CURLOPT_URL=>"https://allpredictor.com/api/v1/validate-key",CURLOPT_RETURNTRANSFER=>true,CURLOPT_HTTPHEADER=>["X-API-Key: ap_votre_clé"]]);
$r=json_decode(curl_exec($ch),true);curl_close($ch);
if(!$r['valid'])die("Clé invalide\n");echo"Plan {$r['plan']}\n";
r=requests.get("https://allpredictor.com/api/v1/validate-key",headers={"X-API-Key":"ap_votre_clé"}).json()
if not r["valid"]:raise ValueError("Clé invalide")
print(f"Plan {r['plan']}")
final r=(await dio.get('/validate-key')).data;
if(!r['valid'])throw Exception('Clé invalide');
uri=URI('https://allpredictor.com/api/v1/validate-key');req=Net::HTTP::Get.new(uri);req['X-API-Key']='ap_votre_clé'
r=JSON.parse(Net::HTTP.start(uri.hostname,uri.port,use_ssl:true){|h|h.request(req)}.body)
raise "Clé invalide" unless r['valid']
req,_:=http.NewRequest("GET","https://allpredictor.com/api/v1/validate-key",nil);req.Header.Set("X-API-Key","ap_votre_clé")
val r=JSONObject(OkHttpClient().newCall(Request.Builder().url("https://allpredictor.com/api/v1/validate-key").get().addHeader("X-API-Key","ap_votre_clé").build()).execute().body?.string()?:"")
var req=URLRequest(url:URL(string:"https://allpredictor.com/api/v1/validate-key")!);req.setValue("ap_votre_clé",forHTTPHeaderField:"X-API-Key")
Réponse 200 — Plan Free
200 OK
{ "valid":true, "plan":"free", "requests_used":153, "requests_remaining":47, "key_name":"Mon Bot Telegram" }
Réponse 200 — Plan Pro
200 OK
{ "valid":true, "plan":"pro", "requests_used":4821, "requests_remaining":"unlimited", "key_name":"Production API" }
Utilitaires

Activer un code d'activation

GET…/api/v1/verify-code

Vérifie et consomme un code d'activation reçu par email après paiement. Le code est marqué comme utilisé après un appel réussi (usage unique).

ParamètreTypeRequisDescription
code string Code d'activation au format XXXX-XXXX-XXXX
curl "https://allpredictor.com/api/v1/verify-code?code=QTWY-3Q3C-MDEL"
const r = await fetch('https://allpredictor.com/api/v1/verify-code?code=QTWY-3Q3C-MDEL').then(r => r.json());
if (r.valid) console.log(`Activé pour ${r.email}`);
r = requests.get("https://allpredictor.com/api/v1/verify-code", params={"code": "QTWY-3Q3C-MDEL"}).json()
if r["valid"]: print(f"Activé pour {r['email']}")
Réponse 200 — Code valide
200 OK
{ "valid": true, "email": "utilisateur@email.com" }
Réponse 200 — Code invalide ou déjà utilisé
200 OK
{ "valid": false, "error": "Ce code est déjà activé sur un autre appareil." }
Utilitaires

Récupérer un code d'activation

GET…/api/get-code

Récupère le code d'activation associé à un paiement. Les deux paramètres ref et email sont obligatoires et doivent correspondre au même paiement.

ParamètreTypeRequisDescription
ref string Référence du paiement GeniusPay
email string Email de l'acheteur
curl "https://allpredictor.com/api/get-code?ref=REF-123&email=utilisateur@email.com"
const r = await fetch('https://allpredictor.com/api/get-code?ref=REF-123&email=utilisateur@email.com').then(r => r.json());
console.log(r.code); // "QTWY-3Q3C-MDEL"
Réponse 200 — Trouvé
200 OK
{ "code": "QTWY-3Q3C-MDEL", "reference": "REF-123" }
Réponse 200 — Non trouvé
200 OK
{ "code": null }
Crime Empire

Prédiction Crime Empire

GEThttps://allpredictor.com/api/v1/{game}/crime

Retourne la prédiction en temps réel pour le jeu Crime Empire. Remplacez {game} par l'un des jeux supportés.

🎮
Jeux supportés : luckyjet, rocketqueen, crash, astro, metacrash, tropicana

Champs de la réponse

ChampTypeDescription
predicted_coeffloatMultiplicateur prédit. Encaissez avant ce seuil.
confidenceintegerScore de confiance 0–100. <60 = peu fiable.
signalenumsafe / warn / danger
bet_timestringHeure locale optimale (HH:MM).
market_scoreintegerScore synthétique du marché (0–100).
avg_recent_coeffloatMoyenne des 8 derniers rounds.
generated_atdatetimeTimestamp ISO 8601 — base du cache.
curl "https://allpredictor.com/api/v1/luckyjet/crime" \
  -H "X-API-Key: ap_votre_clé"
const res = await fetch('https://allpredictor.com/api/v1/luckyjet/crime', {
  headers: { 'X-API-Key': 'ap_votre_clé' }
});
const data = await res.json();
console.log(data.predicted_coef, data.signal);
import requests
r = requests.get("https://allpredictor.com/api/v1/luckyjet/crime",
    headers={"X-API-Key": "ap_votre_clé"}, timeout=5).json()
print(r["predicted_coef"], r["signal"])
Réponse 200
200 OK
{
  "predicted_coef": 2.45,
  "confidence":     78,
  "signal":         "safe",
  "bet_time":       "14:30",
  "market_score":   72,
  "avg_recent_coef":1.98,
  "generated_at":   "2025-01-15T14:28:00Z"
}
IA

Liste des modèles disponibles

GEThttps://allpredictor.com/ia/models

Retourne tous les modèles de chat et d'image disponibles sur l'API IA AllPredictor. Aucune authentification requise.

curl https://allpredictor.com/ia/models
const models = await fetch('https://allpredictor.com/ia/models').then(r => r.json());
console.log(models.data); // tableau de modèles
models = requests.get("https://allpredictor.com/ia/models").json()
for m in models["data"]: print(m["id"], m["name"])
Réponse — modèles gratuits
{
  "object": "list",
  "data": [

    /* ── Chat (tier: free) ── */
    { "id": "@cf/meta/llama-4-scout-17b-16e-instruct",      "name": "Llama 4 Scout 17B",               "provider": "Meta",         "type": "chat",  "tier": "free" },
    { "id": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",     "name": "Llama 3.3 70B Fast",               "provider": "Meta",         "type": "chat",  "tier": "free" },
    { "id": "@cf/meta/llama-3.1-70b-instruct",              "name": "Llama 3.1 70B",                    "provider": "Meta",         "type": "chat",  "tier": "free" },
    { "id": "@cf/meta/llama-3.1-8b-instruct",               "name": "Llama 3.1 8B",                     "provider": "Meta",         "type": "chat",  "tier": "free" },
    { "id": "@cf/meta/llama-3.2-3b-instruct",               "name": "Llama 3.2 3B",                     "provider": "Meta",         "type": "chat",  "tier": "free" },
    { "id": "@cf/meta/llama-3.2-1b-instruct",               "name": "Llama 3.2 1B",                     "provider": "Meta",         "type": "chat",  "tier": "free" },
    { "id": "@cf/mistralai/mistral-small-3.1-24b-instruct", "name": "Mistral Small 3.1 24B",            "provider": "Mistral AI",   "type": "chat",  "tier": "free" },
    { "id": "@cf/mistral/mistral-7b-instruct-v0.1",         "name": "Mistral 7B Instruct",              "provider": "Mistral AI",   "type": "chat",  "tier": "free" },
    { "id": "@cf/google/gemma-4-26b-a4b-it",                "name": "Gemma 4 26B",                      "provider": "Google",       "type": "chat",  "tier": "free" },
    { "id": "@cf/google/gemma-3-12b-it",                    "name": "Gemma 3 12B",                      "provider": "Google",       "type": "chat",  "tier": "free" },
    { "id": "@cf/microsoft/phi-2",                          "name": "Phi-2",                            "provider": "Microsoft",    "type": "chat",  "tier": "free" },
    { "id": "@cf/qwen/qwen2.5-coder-32b-instruct",          "name": "Qwen 2.5 Coder 32B",              "provider": "Qwen",         "type": "chat",  "tier": "free" },
    { "id": "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "name": "DeepSeek R1 Distill 32B",          "provider": "DeepSeek",     "type": "chat",  "tier": "free" },
    { "id": "@cf/zai-org/glm-4.7-flash",                    "name": "GLM-4.7 Flash",                    "provider": "ZAI",          "type": "chat",  "tier": "free" },

    /* ── Image (tier: free) ── */
    { "id": "@cf/stabilityai/stable-diffusion-xl-base-1.0",  "name": "Stable Diffusion XL Base",      "provider": "Stability AI", "type": "image", "tier": "free" },
    { "id": "@cf/bytedance/stable-diffusion-xl-lightning",    "name": "Stable Diffusion XL Lightning", "provider": "ByteDance",    "type": "image", "tier": "free" },
    { "id": "@cf/lykon/dreamshaper-8-lcm",                    "name": "DreamShaper 8 LCM",             "provider": "Lykon",        "type": "image", "tier": "free" }
  ]
}
IA

Chat / Complétion de texte

POSThttps://allpredictor.com/ia/chat

Envoie une conversation à un modèle LLM. Par défaut la réponse est streamée en Server-Sent Events. Passez "stream": false pour recevoir un JSON unique compatible OpenAI. Consomme 1 crédit API par appel.

curl -X POST https://allpredictor.com/ia/chat \
  -H "X-API-Key: ap_votre_clé" \
  -H "Content-Type: application/json" \
  -d '{"model":"@cf/meta/llama-3.3-70b-instruct-fp8-fast","messages":[{"role":"user","content":"Bonjour !"}],"stream":false}'
const res = await fetch('https://allpredictor.com/ia/chat', {
  method: 'POST',
  headers: { 'X-API-Key': process.env.ALLPREDICTOR_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    model: '@cf/meta/llama-3.3-70b-instruct-fp8-fast',
    messages: [{ role: 'user', content: 'Bonjour !' }],
    stream: false,
  }),
});
const { choices } = await res.json();
console.log(choices[0].message.content);
r = requests.post("https://allpredictor.com/ia/chat",
  headers={"X-API-Key": "ap_votre_clé", "Content-Type": "application/json"},
  json={"model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
        "messages": [{"role": "user", "content": "Bonjour !"}], "stream": False}).json()
print(r["choices"][0]["message"]["content"])
const res = await fetch('https://allpredictor.com/ia/chat', {
  method: 'POST',
  headers: { 'X-API-Key': process.env.ALLPREDICTOR_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({ model: '@cf/meta/llama-3.3-70b-instruct-fp8-fast',
    messages: [{ role: 'user', content: 'Raconte une histoire.' }] }), // stream: true par défaut
});
const reader = res.body.getReader();
const dec = new TextDecoder();
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  process.stdout.write(dec.decode(value));
}
Réponse (stream: false)
{
  "id": "allpredictor-1716200000000",
  "object": "chat.completion",
  "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
  "choices": [{
    "index": 0,
    "message": { "role": "assistant", "content": "Bonjour ! Comment puis-je vous aider ?" },
    "finish_reason": "stop"
  }],
  "usage": { "latency_ms": 840, "requests_remaining": 198 }
}
IA

Génération d'image

POSThttps://allpredictor.com/ia/image

Génère une image à partir d'un prompt texte. La réponse est un binaire image/png. Consomme 1 crédit API par appel.

curl -X POST https://allpredictor.com/ia/image \
  -H "X-API-Key: ap_votre_clé" \
  -H "Content-Type: application/json" \
  -d '{"model":"@cf/stabilityai/stable-diffusion-xl-base-1.0","prompt":"Un coucher de soleil sur la mer"}' \
  --output image.png
const res = await fetch('https://allpredictor.com/ia/image', {
  method: 'POST',
  headers: { 'X-API-Key': process.env.ALLPREDICTOR_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    model: '@cf/stabilityai/stable-diffusion-xl-base-1.0',
    prompt: 'Un coucher de soleil sur la mer',
    negative_prompt: 'blurry, low quality', // optionnel
    num_steps: 20, // optionnel, max 20
  }),
});
const blob = await res.blob();
const url = URL.createObjectURL(blob);
document.querySelector('img').src = url;
r = requests.post("https://allpredictor.com/ia/image",
  headers={"X-API-Key": "ap_votre_clé", "Content-Type": "application/json"},
  json={"model": "@cf/stabilityai/stable-diffusion-xl-base-1.0",
        "prompt": "Un coucher de soleil sur la mer"})
with open("image.png", "wb") as f: f.write(r.content)
Réponse
Content-Type: image/png
X-Requests-Remaining: 197

[binary PNG data]
Monétisation

Compte de monétisation

GEThttps://allpredictor.com/api/v1/monetize/account

Retourne le solde publisher, le solde annonceur, les statistiques globales et les dernières transactions du compte de monétisation.

Champs de la réponse

ChampTypeDescription
publisher_balancenumberSolde publisher (revenus des pubs diffusées dans vos bots).
advertiser_balancenumberSolde annonceur (crédits disponibles pour vos campagnes).
monthly_revenuenumberRevenus publisher ce mois-ci.
total_earningsnumberCumul total des revenus publisher.
total_spentnumberTotal dépensé en publicités.
total_viewsnumberTotal de diffusions publicitaires.
active_adsintegerNombre de campagnes actives.
active_botsintegerNombre de bots avec monétisation activée.
total_usersintegerTotal d'utilisateurs sur vos bots monétisés.
recent_transactionsarray10 dernières transactions.
withdrawalsarray5 derniers retraits.
curl "https://allpredictor.com/api/v1/monetize/account" \
  -H "X-API-Key: ap_votre_clé"
const res = await fetch('/api/v1/monetize/account', {
  headers: { 'X-API-Key': 'ap_votre_clé' }
});
const { publisher_balance, advertiser_balance } = await res.json();
Monétisation

Gestion des bots monétisés

GEThttps://allpredictor.com/api/v1/monetize/bots
POSThttps://allpredictor.com/api/v1/monetize/bots

GET — liste vos bots déployés avec leurs statistiques de monétisation.
POST — active ou désactive la monétisation pour un bot.

Body POST

ChampTypeRequisDescription
botIdstringIdentifiant du bot Firestore.
enabledbooleantrue pour activer, false pour désactiver.
curl "https://allpredictor.com/api/v1/monetize/bots" \
  -H "X-API-Key: ap_votre_clé"
curl "https://allpredictor.com/api/v1/monetize/bots" \
  -X POST \
  -H "X-API-Key: ap_votre_clé" \
  -H "Content-Type: application/json" \
  -d '{"botId":"bot_abc123","enabled":true}'
// Activer la monétisation
await fetch('/api/v1/monetize/bots', {
  method: 'POST',
  headers: { 'X-API-Key': 'ap_votre_clé', 'Content-Type': 'application/json' },
  body: JSON.stringify({ botId: 'bot_abc123', enabled: true })
});
Monétisation

Campagnes publicitaires

GEThttps://allpredictor.com/api/v1/monetize/ads
POSThttps://allpredictor.com/api/v1/monetize/ads

GET — liste vos campagnes actives et en pause.
POST — crée une nouvelle campagne (déduit le budget du solde annonceur).
POST ?id=X&action=status&status=Y — change le statut (active/paused).
DELETE ?id=X — supprime une campagne et rembourse le budget non dépensé.

💰
300 F par diffusion. Le budget est débité du solde annonceur à la création. Types supportés : video, texte, lien, icone, emoji, musique, audio, image.

Body POST (création)

ChampTypeRequisDescription
namestringNom de la campagne.
typeenumType de publicité (video, texte, lien…).
contentstringContenu de la publicité.
budgetnumberBudget total en F CFA (min 300).
urlstringURL de destination (optionnel).
targetstringCible (all par défaut).
curl "https://allpredictor.com/api/v1/monetize/ads" \
  -X POST \
  -H "X-API-Key: ap_votre_clé" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ma pub","type":"texte","content":"Rejoignez AllPredictor !","budget":3000}'
const res = await fetch('/api/v1/monetize/ads', {
  method: 'POST',
  headers: { 'X-API-Key': 'ap_clé', 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'Ma pub', type: 'texte',
    content: 'Rejoignez AllPredictor !', budget: 3000
  })
});
const d = await res.json();
console.log(d.id, d.views_estimated); // 10 diffusions estimées
Monétisation

Revenus publisher

GEThttps://allpredictor.com/api/v1/monetize/revenue

Retourne l'historique des revenus publisher (publisher_credit) avec une agrégation par bot.

Champs de la réponse

ChampTypeDescription
by_botarrayRevenus agrégés par bot — {id, name, earnings, views}.
historyarray100 dernières transactions publisher_credit.
curl "https://allpredictor.com/api/v1/monetize/revenue" \
  -H "X-API-Key: ap_votre_clé"
const { by_bot, history } = await fetch('/api/v1/monetize/revenue', {
  headers: { 'X-API-Key': 'ap_votre_clé' }
}).then(r => r.json());
by_bot.forEach(b => console.log(b.name, b.earnings + ' F'));
Monétisation

Recharge annonceur (GeniusPay)

POSThttps://allpredictor.com/api/v1/monetize/recharge

Crée une session de paiement GeniusPay et retourne payment_url. Redirigez l'utilisateur vers cette URL pour finaliser le paiement. Le solde annonceur est crédité automatiquement via webhook après confirmation.

🔒
Flux automatique. Aucune intervention admin requise. Le webhook /api/monetize-webhook crédite le advertiser_balance dès que GeniusPay confirme le paiement.

Body

ChampTypeRequisDescription
amountnumberMontant à recharger en F CFA (min 300).
namestringNom du payeur (optionnel).
phonestringNuméro de téléphone (optionnel).

Réponse 200

ChampTypeDescription
payment_urlstringURL GeniusPay vers laquelle rediriger l'utilisateur.
referencestringRéférence de la transaction GeniusPay.
curl "https://allpredictor.com/api/v1/monetize/recharge" \
  -X POST \
  -H "X-API-Key: ap_votre_clé" \
  -H "Content-Type: application/json" \
  -d '{"amount":3000}'
const { payment_url } = await fetch('/api/v1/monetize/recharge', {
  method: 'POST',
  headers: { 'X-API-Key': 'ap_votre_clé', 'Content-Type': 'application/json' },
  body: JSON.stringify({ amount: 3000 })
}).then(r => r.json());

window.location.href = payment_url; // Redirection vers GeniusPay
Réponse 200
200 OK
{
  "success":     true,
  "payment_url": "https://pay.genius.ci/checkout/abc123",
  "reference":   "GP-2025-XXXX"
}
Monétisation

Demande de retrait

POSThttps://allpredictor.com/api/v1/monetize/withdraw

Soumet une demande de retrait du solde publisher. Le montant est déduit immédiatement du solde. Traitement sous 48–72h ouvrables.

Body

ChampTypeRequisDescription
amountnumberMontant à retirer en F CFA (min 300).
methodenummtn, orange, moov, wave.
accountstringNuméro Mobile Money.
namestringNom du titulaire du compte.
curl "https://allpredictor.com/api/v1/monetize/withdraw" \
  -X POST \
  -H "X-API-Key: ap_votre_clé" \
  -H "Content-Type: application/json" \
  -d '{"amount":5000,"method":"mtn","account":"+225 07 00 00 00","name":"Jean Dupont"}'
const res = await fetch('/api/v1/monetize/withdraw', {
  method: 'POST',
  headers: { 'X-API-Key': 'ap_votre_clé', 'Content-Type': 'application/json' },
  body: JSON.stringify({
    amount: 5000, method: 'mtn',
    account: '+225 07 00 00 00', name: 'Jean Dupont'
  })
});
const { success, id } = await res.json();
Réponse 200
200 OK
{ "success": true, "id": "wdXXXXXXXX", "amount": 5000, "status": "pending" }
Monétisation

Script d'intégration pour bots

GEThttps://allpredictor.com/api/v1/monetize/serve?botId={botId}&userId={userId}

Cet endpoint est appelé automatiquement par le SDK. À chaque appel, il sélectionne une publicité active, crédite 300 F sur votre solde publisher et comptabilise l'utilisateur unique.

📦
Téléchargez le script depuis le dépôt et copiez-le dans votre projet bot. Aucune dépendance npm/pip à installer sauf aiohttp pour Python.

Étapes d'installation

1
Activez la monétisation
Dans le dashboard AllPredictor → Monétisation → Bots → activez le switch de votre bot.
2
Copiez le script SDK
Téléchargez allpredictor_monetize.py (Python) ou allpredictor-monetize.js (Node.js) et placez-le dans votre dossier bot.
3
Initialisez dans votre bot
Créez une instance avec votre clé API et l'ID de votre bot, puis appelez get_ad() / getAd() dans chaque handler.
4
Affichez la pub dans vos messages
Concaténez le résultat de format_ad() / formatAd() à la fin de votre message. Parse mode : HTML.
# 1. Copiez allpredictor_monetize.py dans votre projet
# 2. pip install aiohttp (si pas déjà installé)

from telegram import Update
from telegram.ext import Application, CommandHandler, ContextTypes
from allpredictor_monetize import AllPredictorMonetize

# Initialisation (une seule fois)
mnt = AllPredictorMonetize(
    api_key = "ap_votre_clé_api",
    bot_id  = "VOTRE_BOT_ID",
)

# Handler /start
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
    user_id = update.effective_user.id
    ad      = await mnt.get_ad(user_id=user_id)
    msg     = "👋 Bienvenue !\n\n📊 Prédiction du moment : 2.45x"
    msg    += mnt.format_ad(ad)
    await update.message.reply_text(msg, parse_mode="HTML")

# Handler /predict — raccourci encore plus court
async def predict(update: Update, context: ContextTypes.DEFAULT_TYPE):
    msg = await mnt.append_ad(
        "📊 Signal : SAFE · Cible : 2.45x",
        user_id=update.effective_user.id
    )
    await update.message.reply_text(msg, parse_mode="HTML")

if __name__ == "__main__":
    app = Application.builder().token("BOT_TOKEN").build()
    app.add_handler(CommandHandler("start",   start))
    app.add_handler(CommandHandler("predict", predict))
    app.run_polling()
// 1. Copiez allpredictor-monetize.js dans votre projet
const { Bot }                  = require('grammy');
const { AllPredictorMonetize } = require('./allpredictor-monetize');

const bot = new Bot('BOT_TOKEN');
const mnt = new AllPredictorMonetize({
  apiKey: 'ap_votre_clé_api',
  botId:  'VOTRE_BOT_ID',
});

bot.command('start', async (ctx) => {
  const text = await mnt.appendAd(
    '👋 Bienvenue !\n\n📊 Prédiction : <b>2.45x</b>',
    ctx.from.id
  );
  await ctx.reply(text, { parse_mode: 'HTML' });
});

bot.command('predict', async (ctx) => {
  const ad  = await mnt.getAd(ctx.from.id);
  const msg = '📊 Signal : SAFE · Cible : <b>2.45x</b>' + mnt.formatAd(ad);
  await ctx.reply(msg, { parse_mode: 'HTML' });
});

bot.start();
// Telegraf v4
const { Telegraf }             = require('telegraf');
const { AllPredictorMonetize } = require('./allpredictor-monetize');

const bot = new Telegraf('BOT_TOKEN');
const mnt = new AllPredictorMonetize({
  apiKey: 'ap_votre_clé_api',
  botId:  'VOTRE_BOT_ID',
});

bot.start(async (ctx) => {
  const text = await mnt.appendAd(
    '👋 Bienvenue !\n\n📊 Prédiction : <b>2.45x</b>',
    ctx.from.id
  );
  await ctx.replyWithHTML(text);
});

bot.launch();
// node-telegram-bot-api
const TelegramBot           = require('node-telegram-bot-api');
const { AllPredictorMonetize } = require('./allpredictor-monetize');

const bot = new TelegramBot('BOT_TOKEN', { polling: true });
const mnt = new AllPredictorMonetize({
  apiKey: 'ap_votre_clé_api',
  botId:  'VOTRE_BOT_ID',
});

bot.onText(/\/start/, async (msg) => {
  const text = await mnt.appendAd(
    '👋 Bienvenue !\n\n📊 Prédiction : <b>2.45x</b>',
    msg.from.id
  );
  bot.sendMessage(msg.chat.id, text, { parse_mode: 'HTML' });
});
⚠️
Parse mode HTML obligatoire. Le SDK formate les pubs avec des balises HTML Telegram (<b>, <a>, <i>). Assurez-vous que parse_mode="HTML" est activé sur tous vos reply_text / ctx.reply.

ID du bot : trouvez-le dans Dashboard → Bots → colonne ID, ou depuis l'URL de votre bot déployé.

Champs retournés par /monetize/serve

ChampTypeDescription
ad.idstringIdentifiant de la publicité.
ad.typeenumType : texte, lien, image, video, audio, emoji, icone.
ad.contentstringContenu principal à afficher.
ad.urlstring|nullURL de destination (optionnel).
new_userbooleantrue si c'est la première interaction de cet utilisateur.
Référence

Codes d'erreur

Erreurs HTTP standards avec corps JSON structuré.

400
Bad Request
Paramètre invalide (ex. limit hors plage). Vérifiez les types et plages.
401
Unauthorized
X-API-Key absent, mal formé ou clé révoquée. Régénérez depuis le dashboard.
403
Forbidden
Plan insuffisant pour cet endpoint. Passez au Plan Pro.
429
Too Many Requests
Quota Free (200 req/mois) épuisé. Réinitialisation le 1er du mois à minuit UTC.
500
Internal Server Error
Réessayez avec backoff exponentiel (1s → 2s → 4s). Signalez les 500 persistants au support.
Exemple d'erreur
401 Unauthorized
{ "success":false, "error":"Clé API invalide ou expirée." }
Référence

Rate limiting & quotas

Quotas mensuels par clé API, remis à zéro le 1er de chaque mois à minuit UTC.

Free
Gratuit · réinitialisation mensuelle
200 requêtes / mois
1 clé API
1 bot Telegram
Requêtes illimitées
Pro
Plan payant · sans limite
Requêtes illimitées
Clés API illimitées
Bots Telegram illimités
Support prioritaire
⚠️
Pas de header rate-limit dans les réponses. Utilisez GET /validate-keyrequests_remaining pour connaître votre solde (sans consommer de quota).
Outils Développeur

Spécification OpenAPI

La spécification complète de l'API est disponible au format OpenAPI 3.0. Importez-la directement dans Postman, Insomnia, Swagger UI ou tout autre client REST compatible.

Télécharger openapi.yaml Run in Postman Swagger UI
Format URL Usage
OpenAPI 3.0 YAML /openapi-enriched.yaml Postman, Insomnia, génération de SDK
OpenAPI 3.0 JSON /openapi.json Intégrations programmatiques
Swagger UI /api/v1/docs Exploration interactive en navigateur
Outils Développeur

Sandbox & clés de test

Testez votre intégration sans consommer votre quota mensuel. L'environnement sandbox retourne des données simulées réalistes avec les mêmes schémas de réponse que la production.

🧪
Clé sandbox : utilisez le préfixe ap_test_ pour générer une clé sandbox depuis votre dashboard. Les requêtes sandbox ne sont jamais comptabilisées dans votre quota.
Environnement Base URL Quota
Production https://allpredictor.com/api/v1 Selon votre plan
Sandbox https://sandbox.allpredictor.com/api/v1 Illimité — données simulées
# Sandbox — utiliser la base URL sandbox avec votre clé test
curl https://sandbox.allpredictor.com/api/v1/luckyjet/predict   -H "X-API-Key: ap_test_votre_clé_sandbox"
const BASE = process.env.NODE_ENV === 'production'
  ? 'https://allpredictor.com/api/v1'
  : 'https://sandbox.allpredictor.com/api/v1';

const KEY = process.env.NODE_ENV === 'production'
  ? process.env.ALLPREDICTOR_KEY
  : process.env.ALLPREDICTOR_TEST_KEY;

const data = await fetch(`${BASE}/luckyjet/predict`,
  { headers: { 'X-API-Key': KEY } }).then(r => r.json());
import os, requests

BASE = ("https://allpredictor.com/api/v1"
        if os.getenv("ENV") == "production"
        else "https://sandbox.allpredictor.com/api/v1")

KEY = (os.getenv("ALLPREDICTOR_KEY")
       if os.getenv("ENV") == "production"
       else os.getenv("ALLPREDICTOR_TEST_KEY"))

data = requests.get(f"{BASE}/luckyjet/predict",
    headers={"X-API-Key": KEY}).json()
Outils Développeur

SDKs officiels

Des packages officiels sont disponibles pour les principales plateformes. Ils gèrent automatiquement l'authentification, les retries et la désérialisation des réponses.

📦
JavaScript / Node.js
npm · allpredictor-js
TypeScript natif
Retry automatique
Support ESM & CJS
🐍
Python
pip · allpredictor-python
Async/await (aiohttp)
Dataclasses typées
Python 3.8+
💙
Flutter / Dart
pub.dev · allpredictor_dart
Null-safety
Modèles générés
Dart 3+
🐘
PHP
composer · allpredictor/php-sdk
PHP 8.1+
PSR-18 compatible
Laravel ready
npm install allpredictor-js

# Utilisation
import { AllPredictor } from 'allpredictor-js';
const client = new AllPredictor({ apiKey: process.env.ALLPREDICTOR_KEY });
const pred = await client.luckyjet.predict();
console.log(pred.predicted_coef, pred.signal);
pip install allpredictor-python

# Utilisation
from allpredictor import AllPredictor
client = AllPredictor(api_key="ap_votre_clé")
pred = client.luckyjet.predict()
print(pred.predicted_coef, pred.signal)
flutter pub add allpredictor_dart

// Utilisation
import 'package:allpredictor_dart/allpredictor_dart.dart';
final client = AllPredictor(apiKey: 'ap_votre_clé');
final pred = await client.luckyjet.predict();
print(pred.predictedCoef);
composer require allpredictor/php-sdk

// Utilisation
use AllPredictor\Client;
$client = new Client('ap_votre_clé');
$pred   = $client->luckyjet()->predict();
echo $pred->predictedCoef;
Temps réel

WebSocket & Server-Sent Events

Pour éviter le polling HTTP intensif, l'API propose deux modes de connexion persistante : WebSocket (bidirectionnel) et SSE (flux unidirectionnel, compatible navigateur).

Protocole URL Usage recommandé
WebSocket wss://allpredictor.com/ws/v1 Bots, apps mobiles, intégrations serveur
SSE https://allpredictor.com/api/v1/stream Navigateur, dashboards React/Vue
const ws = new WebSocket(
  `wss://allpredictor.com/ws/v1?api_key=${process.env.ALLPREDICTOR_KEY}`
);

ws.addEventListener('open', () => {
  // S'abonner aux signaux LuckyJet
  ws.send(JSON.stringify({ subscribe: ['luckyjet.signal'] }));
});

ws.addEventListener('message', (event) => {
  const { type, data } = JSON.parse(event.data);
  if (type === 'luckyjet.signal') {
    console.log(`Signal: ${data.signal} | Cible: ${data.predicted_coef}x`);
  }
});
// Server-Sent Events — compatible navigateur sans lib
const url = `https://allpredictor.com/api/v1/stream/luckyjet`
          + `?api_key=${API_KEY}`;

const es = new EventSource(url);

es.addEventListener('signal', (e) => {
  const data = JSON.parse(e.data);
  console.log(data.signal, data.predicted_coef);
});

es.addEventListener('error', () => es.close());
import asyncio, websockets, json, os

async def listen():
    uri = (f"wss://allpredictor.com/ws/v1"
           f"?api_key={os.getenv('ALLPREDICTOR_KEY')}")
    async with websockets.connect(uri) as ws:
        await ws.send(json.dumps({"subscribe": ["luckyjet.signal"]}))
        async for msg in ws:
            data = json.loads(msg)
            print(data["data"]["signal"], data["data"]["predicted_coef"])

asyncio.run(listen())
import 'dart:convert';
import 'package:web_socket_channel/web_socket_channel.dart';

final channel = WebSocketChannel.connect(
  Uri.parse('wss://allpredictor.com/ws/v1?api_key=ap_votre_clé'),
);

channel.sink.add(jsonEncode({'subscribe': ['luckyjet.signal']}));

channel.stream.listen((msg) {
  final data = jsonDecode(msg)['data'];
  print('\${data["signal"]} | \${data["predicted_coef"]}x');
});
Temps réel

Webhooks

Configurez une URL de webhook pour être notifié passivement sans maintenir de connexion ouverte. AllPredictor envoie une requête POST vers votre endpoint à chaque changement de signal important.

Événement Déclencheur
signal.changed Le signal passe de safewarn, warndanger, etc.
market.danger Le marché bascule soudainement en danger.
analyse.ready Une nouvelle analyse est disponible après chaque round.
// POST vers votre URL — header X-AllPredictor-Signature inclus
{
  "event": "market.danger",
  "game": "luckyjet",
  "timestamp": "2025-03-15T14:55:00Z",
  "data": {
    "previous_level": "warn",
    "current_level": "danger",
    "score": 18,
    "reason": "3 pertes consécutives"
  }
}
// Express.js — recevoir le webhook
app.post('/webhook/allpredictor', (req, res) => {
  const sig = req.headers['x-allpredictor-signature'];
  // Vérifier la signature HMAC-SHA256
  const expected = crypto
    .createHmac('sha256', process.env.WEBHOOK_SECRET)
    .update(JSON.stringify(req.body))
    .digest('hex');

  if (sig !== expected)
    return res.status(401).send('Invalid signature');

  const { event, data } = req.body;
  if (event === 'market.danger')
    console.log('⛔ Danger détecté !', data.reason);

  res.sendStatus(200);
});
$payload = file_get_contents('php://input');
$sig     = $_SERVER['HTTP_X_ALLPREDICTOR_SIGNATURE'] ?? '';
$expected = hash_hmac('sha256', $payload,
              getenv('WEBHOOK_SECRET'));

if (!hash_equals($expected, $sig))
  http_response_code(401) and exit('Invalid');

$data = json_decode($payload, true);
echo "Événement: {$data['event']}
";
import hmac, hashlib
from flask import Flask, request, abort

app = Flask(__name__)

@app.route('/webhook/allpredictor', methods=['POST'])
def webhook():
    sig = request.headers.get('X-AllPredictor-Signature', '')
    expected = hmac.new(
        os.getenv('WEBHOOK_SECRET').encode(),
        request.data, hashlib.sha256
    ).hexdigest()
    if not hmac.compare_digest(expected, sig):
        abort(401)
    data = request.json
    print(f"Événement: {data['event']}")
    return '', 200
Spécifications Techniques

Nullabilité & CORS

Champs nullables

Certains champs peuvent retourner null dans des conditions spécifiques. Traitez-les toujours comme null-safe dans votre code.

Champ Endpoint Nullable si…
bet_time /predict Aucune heure optimale calculable (marché instable).
requests_remaining /validate-key Plan Pro — quota illimité.
cursor /history Dernière page — plus de résultats disponibles.
avg_recent_coef /predict Moins de 3 rounds historiques disponibles.

Politique CORS

🌐
CORS activé sur tous les endpoints. Les requêtes JavaScript depuis un navigateur sont autorisées. Les headers Origin sont acceptés depuis n'importe quel domaine. Cependant, pour des raisons de sécurité, il est fortement déconseillé d'exposer votre clé API côté client — utilisez un proxy serveur.
Header CORS Valeur
Access-Control-Allow-Origin *
Access-Control-Allow-Methods GET, POST, OPTIONS
Access-Control-Allow-Headers X-API-Key, Content-Type, Accept
Fiabilité

Statut & Uptime

Consultez la page de statut en temps réel pour connaître l'état de l'API, les incidents en cours et l'historique de disponibilité.

Page de statut →
Composant Statut actuel Uptime 30j
API REST Opérationnel 98.7%
WebSocket Opérationnel 97.9%
Sandbox Opérationnel 99.1%
🔔
Abonnez-vous aux alertes sur status.allpredictor.com pour recevoir des notifications par email ou webhook en cas d'incident.
Fiabilité

Changelog

Historique des mises à jour et évolutions de l'API AllPredictor.

v1.0.0
Mar 2025
Lancement initial de l'API AllPredictor
+ 9 endpoints REST pour LuckyJet et RocketQueen
+ Authentification par clé API (X-API-Key)
+ Plans Free (200 req/mois) et Pro (illimité)
+ Signaux marché (safe / warn / danger)
+ Endpoint /validate-key pour vérification de quota
v1.1.0
À venir
Temps réel & pagination
~ Support WebSocket (wss://)
~ Server-Sent Events (SSE)
~ Pagination par curseur sur /history et /coefficients
~ Webhooks pour changements de signal
~ Environnement sandbox dédié
Monetization

Compte & Soldes

Consultez vos soldes, statistiques globales, transactions récentes et historique des retraits.

GET /api/v1/monetize/account
Response 200 OK
{
  "success": true,
  "data": {
    "balances": {
      "main": 1250.75,
      "bonus": 50.00,
      "pending": 120.00,
      "currency": "EUR"
    },
    "stats": {
      "totalRevenue": 5430.50,
      "totalSpent": 3890.25,
      "totalWithdrawn": 2100.00,
      "activeAds": 12,
      "monetizedBots": 5
    },
    "recentTransactions": [
      {
        "id": "txn_abc123",
        "type": "revenue",
        "amount": 45.50,
        "botId": "bot_luckyjet_01",
        "timestamp": "2025-03-15T14:32:00Z"
      },
      {
        "id": "txn_def456",
        "type": "ad_spend",
        "amount": -25.00,
        "adId": "ad_xyz789",
        "timestamp": "2025-03-15T12:10:00Z"
      }
    ],
    "recentWithdrawals": [
      {
        "id": "wd_ghi789",
        "amount": 500.00,
        "status": "completed",
        "method": "bank_transfer",
        "requestedAt": "2025-03-10T09:00:00Z",
        "processedAt": "2025-03-12T15:30:00Z"
      }
    ]
  }
}
Notes:
  • main: Solde principal disponible pour retraits et dépenses
  • bonus: Crédits bonus (non retirables, utilisables pour publicités)
  • pending: Revenus en attente de validation (délai 24-48h)
Monetization

Gestion des Bots

Listez vos bots et activez/désactivez la monétisation pour chacun.

GET /api/v1/monetize/bots
Response 200 OK
{
  "success": true,
  "data": {
    "bots": [
      {
        "id": "bot_luckyjet_01",
        "name": "LuckyJet Predictor v2",
        "game": "luckyjet",
        "monetizationEnabled": true,
        "revenueShare": 70,
        "totalRevenue": 1250.00,
        "activeUsers": 342,
        "createdAt": "2025-01-10T08:00:00Z"
      },
      {
        "id": "bot_rocketqueen_03",
        "name": "Rocket Queen Advanced",
        "game": "rocketqueen",
        "monetizationEnabled": false,
        "revenueShare": 70,
        "totalRevenue": 0.00,
        "activeUsers": 0,
        "createdAt": "2025-02-20T10:30:00Z"
      }
    ]
  }
}
POST /api/v1/monetize/bots
Request Body
{
  "botId": "bot_rocketqueen_03",
  "monetizationEnabled": true,
  "revenueShare": 70
}
Response 200 OK
{
  "success": true,
  "data": {
    "botId": "bot_rocketqueen_03",
    "monetizationEnabled": true,
    "message": "Monetization activated successfully"
  }
}
Monetization

Publicités

Créez, gérez et contrôlez le statut de vos campagnes publicitaires.

GET /api/v1/monetize/ads
Response 200 OK
{
  "success": true,
  "data": {
    "ads": [
      {
        "id": "ad_promo_spring_2025",
        "name": "Promotion Printemps",
        "type": "banner",
        "status": "active",
        "budget": 500.00,
        "spent": 275.50,
        "impressions": 15420,
        "clicks": 892,
        "ctr": 5.78,
        "startDate": "2025-03-01T00:00:00Z",
        "endDate": "2025-03-31T23:59:59Z"
      },
      {
        "id": "ad_influencer_campaign",
        "name": "Campagne Influenceurs",
        "type": "video",
        "status": "paused",
        "budget": 1000.00,
        "spent": 450.00,
        "impressions": 28500,
        "clicks": 1240,
        "ctr": 4.35,
        "startDate": "2025-02-15T00:00:00Z",
        "endDate": "2025-04-15T23:59:59Z"
      }
    ]
  }
}
POST /api/v1/monetize/ads
Request Body
{
  "name": "Nouvelle Campagne",
  "type": "banner",
  "budget": 300.00,
  "startDate": "2025-04-01T00:00:00Z",
  "endDate": "2025-04-30T23:59:59Z",
  "targeting": {
    "games": ["luckyjet", "rocketqueen"],
    "regions": ["FR", "BE", "CH"]
  },
  "creative": {
    "imageUrl": "https://cdn.example.com/banner.png",
    "ctaText": "Essayer Gratuitement",
    "landingUrl": "https://example.com/promo"
  }
}
Response 201 Created
{
  "success": true,
  "data": {
    "id": "ad_new_campaign_2025",
    "status": "pending_review",
    "message": "Ad created and submitted for review"
  }
}
PATCH /api/v1/monetize/ads/:id/status
Request Body
{
  "status": "paused"
}
DELETE /api/v1/monetize/ads/:id
Response 200 OK
{
  "success": true,
  "data": {
    "id": "ad_promo_spring_2025",
    "message": "Ad deleted successfully",
    "refundAmount": 224.50
  }
}
Statuts disponibles:
  • pending_review: En attente de validation par l'équipe
  • active: Campagne en cours de diffusion
  • paused: Campagne temporairement suspendue
  • completed: Budget épuisé ou date de fin atteinte
  • rejected: Campagne refusée (raison fournie)
Monetization

Revenus

Analysez vos revenus par bot et consultez l'historique détaillé.

GET /api/v1/monetize/revenue
Query Parameters
?from=2025-03-01&to=2025-03-31&botId=bot_luckyjet_01&granularity=daily
Response 200 OK
{
  "success": true,
  "data": {
    "summary": {
      "totalRevenue": 2847.50,
      "totalPayout": 1993.25,
      "platformFee": 854.25,
      "currency": "EUR"
    },
    "byBot": [
      {
        "botId": "bot_luckyjet_01",
        "botName": "LuckyJet Predictor v2",
        "revenue": 1850.00,
        "users": 342,
        "subscriptions": 128,
        "oneTimePurchases": 214
      },
      {
        "botId": "bot_rocketqueen_02",
        "botName": "Rocket Queen Pro",
        "revenue": 997.50,
        "users": 186,
        "subscriptions": 75,
        "oneTimePurchases": 111
      }
    ],
    "history": [
      {
        "date": "2025-03-15",
        "revenue": 125.50,
        "newSubscriptions": 12,
        "churn": 3
      },
      {
        "date": "2025-03-14",
        "revenue": 98.75,
        "newSubscriptions": 8,
        "churn": 2
      }
    ]
  }
}
Paramètres de requête:
  • from: Date de début (format YYYY-MM-DD)
  • to: Date de fin (format YYYY-MM-DD)
  • botId: Filtrer par bot spécifique (optionnel)
  • granularity: daily, weekly, monthly (défaut: daily)
Monetization

Recharge de Crédit

Soumettez une demande de recharge de crédit publicitaire. Validation requise par un administrateur.

POST /api/v1/monetize/recharge
Request Body
{
  "amount": 500.00,
  "currency": "EUR",
  "paymentMethod": "bank_transfer",
  "notes": "Recharge pour campagne Q2 2025"
}
Response 201 Created
{
  "success": true,
  "data": {
    "requestId": "req_recharge_abc123",
    "amount": 500.00,
    "status": "pending_admin_approval",
    "submittedAt": "2025-03-15T16:45:00Z",
    "estimatedProcessingTime": "24-48 hours",
    "message": "Recharge request submitted. Admin will review shortly."
  }
}
Important: Les demandes de recharge sont soumises à validation manuelle par notre équipe. Le traitement prend généralement 24 à 48 heures ouvrées. Vous recevrez une notification email lors de la validation.
Monetization

Demande de Retrait

Initiez un retrait de vos gains vers votre méthode de paiement préférée.

POST /api/v1/monetize/withdraw
Request Body
{
  "amount": 250.00,
  "currency": "EUR",
  "method": "bank_transfer",
  "bankDetails": {
    "accountHolder": "Jean Dupont",
    "iban": "FR76 1234 5678 9012 3456 7890 123",
    "bic": "BNPAFRPP"
  },
  "useBonus": false
}
Response 201 Created
{
  "success": true,
  "data": {
    "withdrawalId": "wd_xyz789",
    "amount": 250.00,
    "fee": 2.50,
    "netAmount": 247.50,
    "status": "pending",
    "method": "bank_transfer",
    "requestedAt": "2025-03-15T17:00:00Z",
    "estimatedArrival": "2025-03-18T00:00:00Z",
    "message": "Withdrawal request submitted successfully"
  }
}
Informations importantes:
  • Montant minimum de retrait: 50.00 EUR
  • Frais de retrait: 1% (min 1.00 EUR, max 10.00 EUR)
  • Délai de traitement: 2-5 jours ouvrés selon la méthode
  • Seul le solde main est retirable (pas le solde bonus)
  • Les revenus en attente (pending) doivent être validés avant retrait
Sécurité: Pour votre sécurité, les premiers retraits peuvent nécessiter une vérification d'identité supplémentaire (KYC). Assurez-vous que vos informations bancaires sont exactes pour éviter tout retard.