curl --request GET \
--url https://www.pierre.finance/tools/api/list-spending-limits \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.pierre.finance/tools/api/list-spending-limits"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.pierre.finance/tools/api/list-spending-limits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.pierre.finance/tools/api/list-spending-limits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.pierre.finance/tools/api/list-spending-limits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.pierre.finance/tools/api/list-spending-limits")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.pierre.finance/tools/api/list-spending-limits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"id": "limit_123456789",
"userId": "user_abc123",
"category": "Alimentação",
"limitAmount": 1000.00,
"period": "monthly",
"isActive": true,
"isRecurring": true,
"periodStart": "2024-11-01T00:00:00.000Z",
"createdAt": "2024-10-15T10:30:00Z",
"updatedAt": "2024-10-15T10:30:00Z",
"currentSpending": 450.75,
"remainingAmount": 549.25,
"percentageUsed": 45.08,
"status": "ok"
},
{
"id": "limit_987654321",
"userId": "user_abc123",
"category": "Transporte",
"limitAmount": 500.00,
"period": "weekly",
"isActive": true,
"isRecurring": false,
"periodStart": "2024-10-28T00:00:00.000Z",
"createdAt": "2024-10-20T14:00:00Z",
"updatedAt": "2024-10-20T14:00:00Z",
"currentSpending": 380.00,
"remainingAmount": 120.00,
"percentageUsed": 76.00,
"status": "warning"
}
],
"count": 2,
"quota": {
"subscriptionType": "pro",
"currentCount": 2,
"limit": 10,
"canCreate": true,
"remaining": 8,
"message": "Plano PRO: 2/10 alertas utilizados. Você pode criar mais 8 alertas.",
"upgradeMessage": null
},
"filters": {
"includeInactive": false
},
"timestamp": "2024-11-04T15:30:00Z"
}
List Spending Limits
Lista todos os limites de gastos do usuário com informações detalhadas de uso atual e validação automática de quota. Para cada limite, calcula automaticamente o valor gasto no período atual, porcentagem de uso, valor restante e status visual. Por padrão retorna apenas limites ativos, mas pode incluir inativos com o parâmetro includeInactive. SEMPRE verifica e retorna informações detalhadas sobre cota do plano (Basic: 0 alertas, Pro: 2 alertas, Premium: 5 alertas) incluindo mensagens formatadas de status e upgrade quando necessário. Requer API key para autenticação e assinatura ativa.
curl --request GET \
--url https://www.pierre.finance/tools/api/list-spending-limits \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.pierre.finance/tools/api/list-spending-limits"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.pierre.finance/tools/api/list-spending-limits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.pierre.finance/tools/api/list-spending-limits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.pierre.finance/tools/api/list-spending-limits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.pierre.finance/tools/api/list-spending-limits")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.pierre.finance/tools/api/list-spending-limits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"id": "limit_123456789",
"userId": "user_abc123",
"category": "Alimentação",
"limitAmount": 1000.00,
"period": "monthly",
"isActive": true,
"isRecurring": true,
"periodStart": "2024-11-01T00:00:00.000Z",
"createdAt": "2024-10-15T10:30:00Z",
"updatedAt": "2024-10-15T10:30:00Z",
"currentSpending": 450.75,
"remainingAmount": 549.25,
"percentageUsed": 45.08,
"status": "ok"
},
{
"id": "limit_987654321",
"userId": "user_abc123",
"category": "Transporte",
"limitAmount": 500.00,
"period": "weekly",
"isActive": true,
"isRecurring": false,
"periodStart": "2024-10-28T00:00:00.000Z",
"createdAt": "2024-10-20T14:00:00Z",
"updatedAt": "2024-10-20T14:00:00Z",
"currentSpending": 380.00,
"remainingAmount": 120.00,
"percentageUsed": 76.00,
"status": "warning"
}
],
"count": 2,
"quota": {
"subscriptionType": "pro",
"currentCount": 2,
"limit": 10,
"canCreate": true,
"remaining": 8,
"message": "Plano PRO: 2/10 alertas utilizados. Você pode criar mais 8 alertas.",
"upgradeMessage": null
},
"filters": {
"includeInactive": false
},
"timestamp": "2024-11-04T15:30:00Z"
}
Descrição
O endpointGET /tools/api/list-spending-limits retorna a lista completa de alertas de gastos configurados pelo usuário, incluindo o gasto atual de cada período, percentual utilizado e informações sobre a quota disponível no plano do usuário.
Autenticação
Este endpoint requer autenticação via Bearer token.Bearer sk-your-api-key-hereParâmetros de Query
true, retorna também os alertas inativos. Por padrão, retorna apenas alertas ativos (false).s=s para requisições MCP.Resposta
Sucesso (200)
{
"success": true,
"data": [
{
"id": "limit_123456789",
"userId": "user_abc123",
"category": "Alimentação",
"limitAmount": 1000.00,
"period": "monthly",
"isActive": true,
"isRecurring": true,
"periodStart": "2024-11-01T00:00:00.000Z",
"createdAt": "2024-10-15T10:30:00Z",
"updatedAt": "2024-10-15T10:30:00Z",
"currentSpending": 450.75,
"remainingAmount": 549.25,
"percentageUsed": 45.08,
"status": "ok"
},
{
"id": "limit_987654321",
"userId": "user_abc123",
"category": "Transporte",
"limitAmount": 500.00,
"period": "weekly",
"isActive": true,
"isRecurring": false,
"periodStart": "2024-10-28T00:00:00.000Z",
"createdAt": "2024-10-20T14:00:00Z",
"updatedAt": "2024-10-20T14:00:00Z",
"currentSpending": 380.00,
"remainingAmount": 120.00,
"percentageUsed": 76.00,
"status": "warning"
}
],
"count": 2,
"quota": {
"subscriptionType": "pro",
"currentCount": 2,
"limit": 10,
"canCreate": true,
"remaining": 8,
"message": "Plano PRO: 2/10 alertas utilizados. Você pode criar mais 8 alertas.",
"upgradeMessage": null
},
"filters": {
"includeInactive": false
},
"timestamp": "2024-11-04T15:30:00Z"
}
Erro de Autenticação (401)
{
"error": "Invalid or inactive API key",
"message": "Please check your API key and try again",
"type": "invalid_api_key"
}
Erro de Quota Excedida (403)
{
"error": "Quota exceeded",
"message": "Plano FREE: 3/3 alertas utilizados. Limite atingido! Faça upgrade para criar mais alertas.",
"success": false
}
Campos da Resposta
Show Spending Limit Object
Show Spending Limit Object
daily, weekly, biweekly, ou monthlyok (0-49%), warning (50-74%), danger (75%+)Show Quota Object
Show Quota Object
free, pro, ou premiumShow Filters Object
Show Filters Object
Exemplos de Uso
cURL
# Listar todos os alertas ativos
curl -X GET 'https://www.pierre.finance/tools/api/list-spending-limits' \
-H 'Authorization: Bearer sk-your-api-key-here'
# Listar todos os alertas (incluindo inativos)
curl -X GET 'https://www.pierre.finance/tools/api/list-spending-limits?includeInactive=true' \
-H 'Authorization: Bearer sk-your-api-key-here'
JavaScript
const API_KEY = 'sk-your-api-key-here';
const BASE_URL = 'https://www.pierre.finance/tools/api';
async function listSpendingLimits(includeInactive = false) {
const params = new URLSearchParams({ includeInactive });
const response = await fetch(`${BASE_URL}/list-spending-limits?${params}`, {
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
}
});
return await response.json();
}
// Exemplos de uso
listSpendingLimits(); // Apenas alertas ativos
listSpendingLimits(true); // Incluindo inativos
Python
import requests
API_KEY = 'sk-your-api-key-here'
BASE_URL = 'https://www.pierre.finance/tools/api'
headers = {
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
}
def list_spending_limits(include_inactive=False):
params = {'includeInactive': str(include_inactive).lower()}
response = requests.get(f'{BASE_URL}/list-spending-limits',
headers=headers, params=params)
return response.json()
# Exemplos de uso
limits = list_spending_limits() # Apenas ativos
all_limits = list_spending_limits(include_inactive=True) # Todos
Códigos de Status
200: Sucesso - Alertas retornados401: Erro de autenticação ou assinatura403: Quota excedida (ao tentar criar novos alertas)500: Erro interno do servidor
Limites por Plano
- FREE: 3 alertas de gastos
- PRO: 10 alertas de gastos
- PREMIUM: 30 alertas de gastos
ok para 0-49%, warning para 50-74%, e danger para 75% ou mais do limite.Authorizations
API key in Bearer token format. Example: Bearer sk-your-api-key-here
Query Parameters
Se deve incluir limites inativos na resposta

