Perforce APIhelp.perforce.com ↗
Access P4 command reference data via API: command syntax, form fields, client options, configurables, and documentation search across Perforce Helix Core.
What is the Perforce API?
This API exposes 9 endpoints that surface structured data from the Perforce Helix Core (P4) command reference documentation at help.perforce.com. Use get_command_page to retrieve syntax, options, usage notes, and examples for any named p4 command, or call get_command_reference_index to get the full alphabetical list of commands with their documentation URLs. Other endpoints cover client spec fields, submit options, line-end modes, and the full configurables table.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/67011ff8-8139-4603-b730-d9cc70602c50/get_client_options_field' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace help-perforce-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: P4Docs SDK — browse commands, search docs, inspect configurables."""
from parse_apis.perforce_p4_cli_documentation_api import P4Docs, Query, CommandName, CommandNotFound
client = P4Docs()
# List available commands from the reference index.
for cmd_summary in client.commandsummaries.list(limit=5):
print(cmd_summary.command, cmd_summary.url)
# Drill into a specific command's full documentation.
sync_cmd = client.commands.get(command_name=CommandName.P4_SYNC)
print(sync_cmd.syntax)
for opt in sync_cmd.options[:3]:
print(opt.flag, opt.description[:60])
# Search documentation for a topic.
result = client.searchresults.search(query=Query.SYNC, limit=1).first()
if result:
print(result.title, result.abstract[:80])
# Navigate from a summary to full command details.
first_summary = client.commandsummaries.list(limit=1).first()
if first_summary:
detail = first_summary.details()
print(detail.command, detail.syntax)
# Typed error handling for a missing command.
try:
client.commands.get(command_name="p4 nonexistent")
except CommandNotFound as exc:
print(f"Not found: {exc.command_name}")
# Fetch the full p4 client reference page.
client_page = client.clientpages.get()
print(client_page.title, client_page.syntax[:60])
# Inspect client workspace options and configurables.
for opt in client.clientoptions.list(limit=3):
print(opt.option, opt.default, opt.meaning[:50])
for cfg in client.configurables.list(limit=3):
print(cfg.name, cfg.client_server_proxy, cfg.default)
print("Exercised: commandsummaries.list / commands.get / searchresults.search / details / clientpages.get / clientoptions.list / configurables.list")
Returns all valid values for the Options field of a p4 client spec, including both affirmative and negated ([no]-prefixed) variants, along with their descriptions and defaults.
No input parameters required.
{
"type": "object",
"fields": {
"items": "array of client option objects with option, raw_text, meaning, and default"
},
"sample": {
"data": {
"items": [
{
"option": "allwrite",
"default": "noallwrite",
"meaning": "If allwrite is set, unopened files are left writable.",
"raw_text": "[no]allwrite"
}
]
},
"status": "success"
}
}About the Perforce API
Command Reference
get_command_reference_index returns every p4 command listed in the alphabetical index, each with a command name and url. From there, get_command_page accepts a command_name parameter — with or without the p4 prefix — and returns structured fields including syntax, description, options (an array of flag/description pairs), usage_notes, and examples. Any of these fields may be null if the documentation page for that command omits the section.
Client Spec Data
Three endpoints dissect the p4 client specification. get_client_form_fields returns every field in the client spec with a field name, inferred type_hint, and description. get_client_options_field enumerates the Options field values, including both affirmative and [no]-prefixed negated variants, with their meaning and default values. get_client_submit_options lists each SubmitOptions value and what it controls about unchanged-file handling during submit. get_client_line_end_options covers each LineEnd value and its workspace line-ending behavior.
Configurables and Search
get_configurables_reference returns the full configurables table — each entry includes the configurable name, client_server_proxy scope tag, default value, and description. This covers server, client, and proxy tunables in a single response.
search_documentation accepts a query string and performs a token-based match against documentation topic titles and abstracts. All space-separated tokens must appear in a topic for it to match. The endpoint scans the first three index chunks, so very broad queries or topics covered only in later chunks may return incomplete results.
The Perforce API is a managed, monitored endpoint for help.perforce.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when help.perforce.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official help.perforce.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a CLI tool that auto-completes p4 command flags by pulling options arrays from
get_command_page. - Generate internal developer wikis by iterating
get_command_reference_indexand fetching descriptions per command. - Validate client spec forms against the canonical field list returned by
get_client_form_fields. - Audit workspace configurations by comparing in-use Options values against the defaults in
get_client_options_field. - Surface configurable tuning recommendations by querying
get_configurables_referencefor defaults and scope. - Add P4 documentation lookup to a chatbot or IDE plugin using
search_documentationplusget_command_page. - Detect deprecated or non-standard SubmitOptions in client specs by cross-referencing
get_client_submit_optionsvalues.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Perforce provide an official developer API for its documentation?+
What does `get_command_page` return, and which fields can be null?+
get_command_page returns syntax, description, options, usage_notes, and examples for the requested command. The syntax, description, usage_notes, and examples fields are typed as string-or-null — if the documentation page for a given command omits that section, the field returns null. The options array will be empty rather than null when no flags are documented.Does `search_documentation` cover the full P4 documentation set?+
Does the API cover P4 admin commands or server-side commands beyond the standard command reference?+
p4d) server administration commands and separate product documentation (e.g., Helix Swarm, GitFusion) are not currently covered. You can fork this API on Parse and revise it to add endpoints targeting those documentation sections.What does `get_client_options_field` return that `get_client_form_fields` does not?+
get_client_form_fields gives one entry per spec field with a type hint and description. get_client_options_field specifically enumerates every valid token for the Options field itself — including the negated [no]-prefixed variants — with individual meaning and default values per token. It is more granular for programmatic validation of the Options string.