From 963080881193b3d2ea610cb45826fe6a6f956174 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 15 Aug 2025 06:10:12 -0400 Subject: [PATCH 1/5] Add API Terms of Service page - Create ApiTermsOfService component with legal terms from Google Doc - Add routing as subpage under /api/terms - Link from API documentation page - Adapt governing law based on country (UK vs US jurisdiction) - Fixes #2734 --- src/PolicyEngine.jsx | 12 +- src/pages/learn/APIGeneralContent.jsx | 4 +- src/pages/learn/ApiTermsOfService.jsx | 340 ++++++++++++++++++++++++++ 3 files changed, 351 insertions(+), 5 deletions(-) create mode 100644 src/pages/learn/ApiTermsOfService.jsx diff --git a/src/PolicyEngine.jsx b/src/PolicyEngine.jsx index 91b8627a3..364b531a1 100644 --- a/src/PolicyEngine.jsx +++ b/src/PolicyEngine.jsx @@ -30,6 +30,7 @@ import Testimonials from "./pages/Testimonials"; import CalculatorInterstitial from "./pages/CalculatorInterstitial"; import CitizensEconomicCouncil from "./applets/CitizensEconomicCouncil"; import APIDocumentationPage from "./pages/learn/APIDocumentationPage"; +import ApiTermsOfService from "./pages/learn/ApiTermsOfService"; import SimulationsPage from "./pages/Simulations"; import CookieConsent from "./modals/CookieConsent"; import TrafwaCalculator from "./applets/TrafwaCalculator"; @@ -380,10 +381,13 @@ export default function PolicyEngine() { } /> - } - /> + }> + } + /> + } /> + {/* redirect from /countryId/blog/slug to /countryId/research/slug */} } /> diff --git a/src/pages/learn/APIGeneralContent.jsx b/src/pages/learn/APIGeneralContent.jsx index 7c33032a8..e574f6964 100644 --- a/src/pages/learn/APIGeneralContent.jsx +++ b/src/pages/learn/APIGeneralContent.jsx @@ -4,6 +4,7 @@ import CodeBlock from "../../layout/CodeBlock"; import style from "../../style"; import { Card, Tag, Tooltip } from "antd"; import { QuestionCircleOutlined } from "@ant-design/icons"; +import { Link } from "react-router-dom"; // During front-end redesign, this page should be refactored // to use design system layout components and improved best practices. @@ -112,7 +113,8 @@ print(response.json())`; hello@policyengine.org - . + . By using the API, you agree to our{" "} + Terms of Service.

On this page

diff --git a/src/pages/learn/ApiTermsOfService.jsx b/src/pages/learn/ApiTermsOfService.jsx new file mode 100644 index 000000000..1062b6f89 --- /dev/null +++ b/src/pages/learn/ApiTermsOfService.jsx @@ -0,0 +1,340 @@ +import { Container } from "react-bootstrap"; +import useMobile from "../../layout/Responsive"; +import { Helmet } from "react-helmet"; +import Header from "../../layout/Header"; +import Footer from "../../layout/Footer"; +import { Link } from "react-router-dom"; +import useCountryId from "../../hooks/useCountryId"; +import { COUNTRY_NAMES } from "../../data/countries"; + +export default function ApiTermsOfService() { + const mobile = useMobile(); + const countryId = useCountryId(); + + const DEFAULT_JURISDICTION = "the District of Columbia"; + + const getJurisdiction = (id) => { + const country = COUNTRY_NAMES[id]; + + if (country) { + return country.phrasal || country.standard; + } + return DEFAULT_JURISDICTION; + }; + + const jurisdiction = getJurisdiction(countryId); + + return ( + <> + + API Terms of Service | PolicyEngine + +
+ +

PolicyEngine API Terms of Service

+ +

+ These PolicyEngine API Terms of Service ("Terms + ") form a binding agreement between PolicyEngine, Inc. (" + + PolicyEngine," "we," "us," or + "our" + + ) and the entity or person agreeing to them (" + Customer," "you," or "your") + that accesses or uses the PolicyEngine application‑programming + interface, endpoints, documentation, and any related services + (collectively, the "API").{" "} + + By requesting API credentials, making an API call, or otherwise + using the API, you accept these Terms. + +

+ +
+ +

1. Definitions

+

+ "AGPL" means the GNU Affero General Public + License v3.0. +
+ "Household Scenario" means data describing + a hypothetical or de‑identified household, such as age bands, income + ranges, and geographic codes that cannot reasonably be linked to an + identified or identifiable person. +
+ "Output" means the JSON or other results + returned by the API in response to a request. +
+ "Request Data" means the payload, headers, + and metadata you submit to the API. +
+ "Service Level Credits" means the fee + credits defined in Section 8. +
+ "Usage Logs" means system logs that include + Request Data or Output and related metadata. +

+ +
+ +

2. API License and Access

+
    +
  1. + Limited License. Subject to these Terms, + PolicyEngine grants you a non‑exclusive, non‑transferable, revocable + license to access and use the API solely to build or operate + software or services that compute or analyze public‑policy outcomes. +
  2. +
  3. + API Keys. You agree to keep your API credentials + confidential and may not share them except with agents acting on + your behalf under written confidentiality obligations. +
  4. +
  5. + Acceptable Use. You will not (a) submit malware, + unlawful content, or personal data that identifies a natural person; + (b) attempt to reverse‑engineer, scrape, or violate rate limits; (c) + use the API to provide legal or tax advice without appropriate + professional oversight; or (d) misrepresent Output as official + government guidance. +
  6. +
+ +
+ +

3. Customer Data

+
    +
  1. + No PII Submission. You shall not submit names, full + street addresses, Social Security numbers, or other direct + identifiers. If you inadvertently submit personal data, you must + notify us promptly and cooperate in deletion. +
  2. +
  3. + Representation. You represent that Request Data + consists of (i) Household Scenarios or (ii) + information you are lawfully authorized to process and share with + PolicyEngine. +
  4. +
  5. + Ownership. You retain all rights in Request Data + and Output, except that you grant PolicyEngine a worldwide, + royalty‑free license to process Request Data and Output to provide + the API and improve our microsimulation models. +
  6. +
+ +
+ +

4. Data Handling & Anonymisation

+

+ PolicyEngine logs request and response data solely for speed of + execution (caching), abuse‑detection, debugging, billing, and + statistical research to improve its microsimulation models. Logs are + never sold, shared with third parties (except subprocessors under + equivalent obligations), or used to train public machine‑learning + models. +

+ +

5. Open‑Source Components

+
    +
  1. + Python Package. Our reference Python implementation + is licensed under the AGPL. API use does not{" "} + trigger AGPL source‑code disclosure, but running or distributing the + package yourself does. +
  2. +
  3. + Priority of Terms. In case of conflict, these API + Terms govern your API access; the AGPL governs your use of our + open‑source code. +
  4. +
+ +
+ +

6. Intellectual‑Property Rights

+
    +
  1. + PolicyEngine IP. Aside from the limited license in + Section 2, PolicyEngine retains all rights in the API, + documentation, and underlying models. +
  2. +
  3. + Feedback. You grant PolicyEngine a perpetual, + irrevocable, royalty‑free license to use any feedback you provide to + improve the API. +
  4. +
+ +
+ +

7. Rate Limits; Fair Use

+

+ We may impose request‑per‑minute or daily volume limits, published in + the dashboard or documentation. Excess use may result in temporary + throttling or suspension without liability. +

+ +
+ +

8. Service Levels & Support

+
    +
  1. + Uptime Commitment. We target{" "} + 99% monthly API availability. If availability drops + below 99%, you may request Service Level Credits equal to 10% of + that month's fees. +
  2. +
  3. + Planned Maintenance. We will give at least 24 + hours' notice for planned downtime exceeding 15 minutes. +
  4. +
  5. + Support. Standard e‑mail support + (support@policyengine.org) is included. Contact{" "} + + support@policyengine.org + {" "} + for enterprise support. +
  6. +
+ +
+ +

9. Security & Privacy

+

+ We maintain administrative, technical, and physical safeguards + designed to protect Request Data. Details appear in our{" "} + Privacy Policy, which is + incorporated by reference. +

+ +
+ +

10. Confidentiality

+

+ Each party will protect the other's non‑public information with + the same care it uses for its own, but at least reasonable care, and + will use it only to exercise rights and fulfil obligations under these + Terms. +

+ +
+ +

11. Term & Termination

+
    +
  1. + Term. These Terms start when you first use the API + and continue until terminated. +
  2. +
  3. + Termination for Convenience. Either party may + terminate at any time on 30 days' written notice. +
  4. +
  5. + Termination for Cause. Either party may terminate + immediately if the other materially breaches these Terms and fails + to cure within 15 days of notice. +
  6. +
  7. + Effect. Upon termination you must cease API calls. + Sections 4 (aggregated logs), 5, 6, 10, 12–17 survive. +
  8. +
+ +
+ +

12. Disclaimers

+

+ THE API AND OUTPUT ARE PROVIDED "AS IS". + POLICYENGINE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND + NON‑INFRINGEMENT. OUTPUT IS ILLUSTRATIVE ONLY AND NOT + LEGAL, TAX, OR FINANCIAL ADVICE. +

+ +
+ +

13. Limitation of Liability

+
    +
  1. + Indirect Damages. POLICYENGINE WILL NOT BE LIABLE + FOR INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, OR LOSS + OF PROFITS OR DATA, EVEN IF ADVISED OF THE POSSIBILITY. +
  2. +
  3. + Cap. POLICYENGINE'S TOTAL LIABILITY WILL NOT + EXCEED THE FEES PAID BY CUSTOMER IN THE 12 MONTHS PRECEDING THE + EVENT GIVING RISE TO THE CLAIM. +
  4. +
+ +
+ +

14. Indemnification

+

+ You will defend, indemnify, and hold harmless PolicyEngine from any + third‑party claim arising from your (a) misuse of the API, (b) + violation of these Terms, or (c) infringement of intellectual‑property + or privacy rights. +

+ +
+ +

15. Modifications to the API or Terms

+

+ We may modify these Terms or the API by posting an updated version or + sending notice to your account e‑mail. Changes take effect 30 days + after notice. Continued use constitutes acceptance. +

+ +
+ +

16. Governing Law; Dispute Resolution

+

+ These Terms are governed by the laws of {jurisdiction}, excluding its + conflict of law rules. The parties will resolve disputes exclusively + in the federal or state courts located in{" "} + {jurisdiction === "the United Kingdom" ? "London" : "Washington, DC"}, + and consent to personal jurisdiction there. +

+ +
+ +

17. Assignment; Entire Agreement

+

+ You may not assign these Terms without PolicyEngine's prior + written consent. These Terms, any Order Form, and the documents linked + herein constitute the entire agreement and supersede all prior + agreements regarding their subject. +

+ +
+ +

18. Contact

+

+ Questions may be directed to legal@policyengine.org +

+ +
+ +

+ + By using the API you acknowledge that you have read, understood, and + agree to be bound by these Terms. + +

+
+