Shared Forest Ask API
The Ask API from Shared Forest — 1 operation(s) for ask.
The Ask API from Shared Forest — 1 operation(s) for ask.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/sharedforest-com:sharedforest-com-ask-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Shared Forest Ask API
version: 1.0.0
summary: Read the live shared forest, plant a tree and sponsor premium painted trees.
description: 'Shared Forest is a free, shared illustrated forest that grows from its traffic. Every page load adds growth energy, and every visitor, human or AI agent, can plant one tree per day. The REST endpoints need no authentication and no API keys. The account tools of the MCP server use OAuth 2.1 (securitySchemes.oauth2, walkthrough https://sharedforest.com/auth.md). Rate limit: 120 requests per minute per IP address. Errors use application/problem+json (RFC 9457). Versioning: URL path /api/v1/ and the API-Version response header. Deprecation policy: A deprecated version returns a Deprecation header (RFC 9745) on every response and a Sunset header (RFC 8594) with the removal date. The Sunset date is at least 90 days after the first Deprecation header.'
contact:
name: Arne Kellmann
email: contact@sharedforest.com
url: https://sharedforest.com/contact
x-api-version: '1'
x-api-version-policy:
scheme: url-path
current: v1
pathPrefix: /api/v1/
header: API-Version
policy: Changes inside a major version are additive only. A breaking change gets a new path version.
deprecation: A deprecated version returns a Deprecation header (RFC 9745) on every response and a Sunset header (RFC 8594) with the removal date. The Sunset date is at least 90 days after the first Deprecation header.
headers:
- Deprecation
- Sunset
noticePeriodDays: 90
docs: https://sharedforest.com/developers
x-deprecation-policy:
headers:
- Deprecation
- Sunset
noticePeriodDays: 90
description: A deprecated version returns a Deprecation header (RFC 9745) on every response and a Sunset header (RFC 8594) with the removal date. The Sunset date is at least 90 days after the first Deprecation header.
servers:
- url: https://sharedforest.com
security: []
tags:
- name: Ask
paths:
/ask:
get:
operationId: askForestGet
summary: Ask a question (NLWeb)
description: NLWeb /ask. Answers from the live forest stats and the documentation.
parameters:
- name: query
in: query
required: true
description: Question in plain language.
schema:
type: string
minLength: 1
maxLength: 500
- name: streaming
in: query
required: false
description: true returns text/event-stream (NLWeb start, result, complete events).
schema:
type: boolean
default: false
responses:
'200':
description: NLWeb answer. JSON by default, Server-Sent Events when streaming is true.
headers:
RateLimit:
$ref: '#/components/headers/RateLimit'
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
API-Version:
$ref: '#/components/headers/ApiVersion'
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
content:
application/json:
schema:
$ref: '#/components/schemas/AskResponse'
text/event-stream:
schema:
type: string
description: Events start, result (one per result) and complete.
'400':
description: Invalid request. The detail field says what to change.
headers:
RateLimit:
$ref: '#/components/headers/RateLimit'
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
API-Version:
$ref: '#/components/headers/ApiVersion'
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'405':
description: Method not allowed. See the Allow header.
headers:
RateLimit:
$ref: '#/components/headers/RateLimit'
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
API-Version:
$ref: '#/components/headers/ApiVersion'
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'429':
description: Rate limit reached. Wait for Retry-After seconds.
headers:
RateLimit:
$ref: '#/components/headers/RateLimit'
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
API-Version:
$ref: '#/components/headers/ApiVersion'
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
Retry-After:
$ref: '#/components/headers/RetryAfter'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
5XX:
description: Server error. Retry after a few seconds.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
tags:
- Ask
post:
operationId: askForest
summary: Ask a question (NLWeb)
description: NLWeb /ask. Answers from the live forest stats and the documentation. Set prefer.streaming to true for Server-Sent Events.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AskRequest'
responses:
'200':
description: NLWeb answer. JSON by default, Server-Sent Events when streaming is true.
headers:
RateLimit:
$ref: '#/components/headers/RateLimit'
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
API-Version:
$ref: '#/components/headers/ApiVersion'
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
content:
application/json:
schema:
$ref: '#/components/schemas/AskResponse'
text/event-stream:
schema:
type: string
description: Events start, result (one per result) and complete.
'400':
description: Invalid request. The detail field says what to change.
headers:
RateLimit:
$ref: '#/components/headers/RateLimit'
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
API-Version:
$ref: '#/components/headers/ApiVersion'
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'405':
description: Method not allowed. See the Allow header.
headers:
RateLimit:
$ref: '#/components/headers/RateLimit'
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
API-Version:
$ref: '#/components/headers/ApiVersion'
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
'429':
description: Rate limit reached. Wait for Retry-After seconds.
headers:
RateLimit:
$ref: '#/components/headers/RateLimit'
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
API-Version:
$ref: '#/components/headers/ApiVersion'
Deprecation:
$ref: '#/components/headers/Deprecation'
Sunset:
$ref: '#/components/headers/Sunset'
Retry-After:
$ref: '#/components/headers/RetryAfter'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
5XX:
description: Server error. Retry after a few seconds.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
tags:
- Ask
components:
schemas:
Problem:
type: object
required:
- type
- title
- status
- detail
properties:
type:
type: string
description: Error type URI, about:blank for plain HTTP errors.
title:
type: string
description: Short HTTP status text.
status:
type: integer
description: HTTP status code.
detail:
type: string
description: What went wrong and how to fix the request.
AskRequest:
type: object
required:
- query
properties:
query:
type: string
minLength: 1
maxLength: 500
query_id:
type: string
description: Optional client id, echoed back.
prefer:
type: object
properties:
streaming:
type: boolean
default: false
AskResponse:
type: object
required:
- query_id
- _meta
- results
properties:
query_id:
type: string
_meta:
type: object
required:
- response_type
- version
properties:
response_type:
type: string
const: list
version:
type: string
results:
type: array
items:
type: object
required:
- url
- name
- site
- score
- description
properties:
url:
type: string
format: uri
name:
type: string
site:
type: string
score:
type: number
description:
type: string
schema_object:
type: object
headers:
Sunset:
description: 'RFC 8594. Present only on responses of a deprecated API version: the HTTP date after which the version is removed, at least 90 days after deprecation.'
schema:
type: string
Deprecation:
description: 'RFC 9745. Present only on responses of a deprecated API version: the Unix time of deprecation, for example @1767225600. Version 1 is not deprecated.'
schema:
type: string
RateLimit:
description: Remaining quota and seconds to reset, for example "default";r=119;t=60.
schema:
type: string
RetryAfter:
description: Seconds to wait before the next request.
schema:
type: integer
ApiVersion:
description: Major version of the REST API.
schema:
type: string
example: '1'
RateLimitPolicy:
description: Quota policy, for example "default";q=120;w=60.
schema:
type: string
securitySchemes:
oauth2:
type: oauth2
description: 'OAuth 2.1 with PKCE (S256) for the account tools of the MCP server https://sharedforest.com/mcp. Dynamic Client Registration at https://sharedforest.com/oauth/register. Walkthrough: https://sharedforest.com/auth.md.'
flows:
authorizationCode:
authorizationUrl: https://sharedforest.com/oauth/authorize
tokenUrl: https://sharedforest.com/oauth/token
refreshUrl: https://sharedforest.com/oauth/token
scopes:
forest:read: Read the forest, prices and designs. Always granted; the same data is public.
sponsor:write: Start tree sponsorships in your name, within the spending limit. You still confirm and pay each order yourself.
account:read: Read your orders and your sponsored trees.
externalDocs:
description: Developer portal
url: https://sharedforest.com/developers
x-versioning-policy:
scheme: url-path
current: v1
pathPrefix: /api/v1/
header: API-Version
policy: Changes inside a major version are additive only. A breaking change gets a new path version.
deprecation: A deprecated version returns a Deprecation header (RFC 9745) on every response and a Sunset header (RFC 8594) with the removal date. The Sunset date is at least 90 days after the first Deprecation header.
headers:
- Deprecation
- Sunset
noticePeriodDays: 90
docs: https://sharedforest.com/developers