Skip to content
Skillv1.0.0

clari-rate-limits

Handle Clari API rate limits with backoff and export job scheduling. Use when hitting 429 errors, optimizing export frequency, or scheduling bulk forecast exports. Trigger with phrases like "clari rat

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/clari-rate-limits/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill clari-rate-limits. Copyright stays with the author (MIT).

Clari Rate Limits

Overview

The Clari API enforces rate limits per API key. Export jobs are asynchronous and queued server-side, so the primary concern is polling frequency and concurrent export requests.

Prerequisites

  • A scoped API token and approved forecast export scope
  • Persistent job/attempt tracking for retry and idempotency decisions
  • A scheduler that can defer work without spawning duplicate workers
  • Monitoring for queue depth, response class, and terminal failures

Rate Limit Behavior

Aspect Value
Scope Per API key
Response on limit HTTP 429
Export job queue Server-managed, async
Recommended polling 5-10 second intervals

Instructions

Exponential Backoff for Export Polling

import time
import requests

def poll_with_backoff(
    job_id: str,
    api_key: str,
    max_attempts: int = 60,
    base_delay: float = 5.0,
    max_delay: float = 60.0,
) -> dict:
    for attempt in range(max_attempts):
        resp = requests.get(
            f"https://api.clari.com/v4/export/jobs/{job_id}",
            headers={"apikey": api_key},
        )

        if resp.status_code == 429:
            retry_after = int(resp.headers.get("Retry-After", base_delay))
            time.sleep(retry_after)
            continue

        resp.raise_for_status()
        status = resp.json()

        if status["status"] in ("COMPLETED", "FAILED"):
            return status

        delay = min(base_delay * (1.5 ** attempt), max_delay)
        time.sleep(delay)

    raise TimeoutError(f"Job {job_id} did not complete in {max_attempts} attempts")

Sequential Export Scheduler

def export_all_periods(
    client,
    forecast_name: str,
    periods: list[str],
    delay_between: float = 10.0,
) -> list[dict]:
    results = []
    for period in periods:
        print(f"Exporting {period}...")
        job = client.export_forecast(forecast_name, period)
        result = poll_with_backoff(job["jobId"], client.config.api_key)
        results.append(result)
        time.sleep(delay_between)  # Avoid hitting rate limits
    return results

Error Handling

Scenario Detection Response
429 with Retry-After Check header Wait exact duration
429 without header Status code only Backoff from 5s
Job queue full Multiple pending jobs Wait for completion before new exports

Output

Return a per-job state record with export period, provider job ID, attempts, applied delay, response class, and terminal decision. Do not report tokens or raw forecast records; callers must receive a bounded retryable failure rather than silently starting a parallel export.

Examples

Submit one export for a staging period and persist its job ID before polling. On a 429 with Retry-After, reschedule the same job after that interval; if the attempt budget expires, mark the run unavailable and alert the scheduler instead of issuing another export request.

Resources

Next Steps

For security configuration, see clari-security-basics.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-clari-rate-limits/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-clari-rate-limits.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-clari-rate-limits",
  "kind": "skill",
  "name": "clari-rate-limits",
  "description": "Handle Clari API rate limits with backoff and export job scheduling. Use when hitting 429 errors, optimizing export frequency, or scheduling bulk forecast exports. Trigger with phrases like \"clari rate limit\", \"clari 429\", \"clari throttle\", \"clari api limits\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "revenue-intelligence",
      "forecasting",
      "clari",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Handle Clari API rate limits with backoff and export job scheduling. Use when hitting 429 errors, optimizing export frequency, or scheduling bulk forecast exports. Trigger with phrases like \"clari rate limit\", \"clari 429\", \"clari throttle\", \"clari api limits\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/clari-rate-limits/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/clari-rate-limits/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/clari-rate-limits/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit"
    ],
    "license": "MIT"
  },
  "instructions": "# Clari Rate Limits\n\n## Overview\n\nThe Clari API enforces rate limits per API key. Export jobs are asynchronous and queued server-side, so the primary concern is polling frequency and concurrent export requests.\n\n## Prerequisites\n\n- A scoped API token and approved forecast export scope\n- Persistent job/attempt tracking for retry and idempotency decisions\n- A scheduler that can defer work without spawning duplicate workers\n- Monitoring for queue depth, response class, and terminal failures\n\n## Rate Limit Behavior\n\n| Aspect | Value |\n|--------|-------|\n| Scope | Per API key |\n| Response on limit ",
  "cost": {
    "context_tokens": 797
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-clari-rate-limits/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.