policyengine-api

Calculate taxes and benefits via a Flask REST API.

31|6|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/PolicyEngine/policyengine-claude --skill policyengine-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: policyengine-api
Source: https://github.com/PolicyEngine/policyengine-claude/tree/main/skills/policyengine-api-skill
Command: npx skills add https://github.com/PolicyEngine/policyengine-claude --skill policyengine-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires flask, requests, redis, rq.

What problem does it solve?

Programmatic access to PolicyEngine's tax and benefit calculations is essential for integration into other applications and for advanced analytical workflows. This Skill details the Flask-based REST API, enabling seamless data exchange and automation.

Core Features & Use Cases

  • Comprehensive Endpoints: Provides endpoints for household calculations, policy management, economy impacts, and metadata.
  • Performance & Caching: Implements Redis caching and background jobs (RQ) for efficient handling of requests and long-running calculations.
  • Country Integration: Dynamically loads and routes requests to specific country packages (US, UK, etc.).
  • Standardized Patterns: Guides on standard endpoint structure, request validation, and error handling.
  • Use Case: Integrate PolicyEngine's household calculation endpoint into a custom web service, ensuring proper request validation, caching, and error handling for optimal performance.

Quick Start

Use the policyengine-api skill to get the URL for the OpenAPI documentation.

Frequently Asked Questions about policyengine-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I access tax and benefit calculations programmatically via REST API?

PolicyEngine's REST API provides programmatic access to tax and benefit calculations through Flask-based endpoints. You can query household calculations, policy reforms, and economy impacts by sending requests to endpoints that handle input validation, caching via Redis, and asynchronous job processing for long-running tasks across multiple country packages.

Can I integrate PolicyEngine calculations into my web application?

Yes. The API integrates into custom web services with built-in request validation, Redis caching for performance, and rate limiting. It dynamically loads country-specific packages (US, UK, etc.) and routes requests accordingly, enabling seamless data exchange while handling both synchronous and asynchronous calculations.

What caching and performance optimization does the API provide?

The API implements Redis caching to reduce redundant calculations and uses RQ for background job processing. This enables efficient handling of high-volume requests and long-running policy simulations while maintaining scalability across multi-country deployments.

How does the API handle long-running policy calculations?

Long-running tasks use asynchronous job handling through RQ, allowing the API to process complex economy impact analyses and policy reforms without blocking requests. Results are cached and retrievable, supporting scalable multi-country policy simulations.

What endpoints does PolicyEngine's REST API expose?

The API provides comprehensive endpoints for household calculations, policy management, economy impacts, and metadata retrieval. Each endpoint follows standardized patterns with proper request validation and error handling, documented via OpenAPI specification.

Do I need to handle country-specific configurations when using the API?

No. The API dynamically loads and routes requests to specific country packages, abstracting country-specific configuration. You specify the country in your request, and the API handles package loading and parameter retrieval automatically.