This is the API equivalent of the PVFARM import in the web application. The web import keeps its review flow, where you can upload PAN and OND files for each equipment type and adjust array and transformer values before anything is created. The API has no review step.
Before you start
You need two things: API credentials, and a prediction to import onto. Credentials. Your company administrator generates them once per user: Manage Account (the gear icon, bottom left), select the user, then Generate API Credentials. Record the Client ID and Client Secret, which are shown only once. Exchange them for an access token using the client credentials grant with your Client ID and Secret sent as a Basic auth header:Authorization: Bearer. Tokens last about an hour, and an import can outlive one, so refresh it if a long poll starts returning 401.
A target prediction. The import lands on an existing prediction, which must:
- be a standard (Block Builder) prediction in one of your projects, and
- already have a weather file selected.
overwriteExistingPowerPlant=true on the import call — your explicit consent to replace the existing plant and its 3D scene. Without it, nothing is ever replaced; importing each design revision onto a fresh prediction keeps your revision history instead.
Create the project and prediction through the API or the website first, and select a weather file on the prediction.
Step 1: send the file
Post the.pvfshade file exactly as PVFARM exported it. An uncompressed .json of the same data is also accepted, though PVFARM does not export one. To replace a plant an earlier import built on this prediction, add ?overwriteExistingPowerPlant=true to the URL (see When an import fails).
202 Accepted straight away, with the ID you use to follow the import:
Step 2: check back until it finishes
The import runs in the background and a large file can take a few minutes. Checking once every 10 seconds is plenty.status is one of three values:
Every response also carries a
summary: one sentence describing the outcome in plain language, which you can show to a person as-is.
A finished import
equipment lists the library records the import created from the file’s datasheet values: one Module per module type and one Inverter per inverter type. Re-importing the same file reuses the same records instead of creating duplicates, and says so in notices.
When an import fails
Failed means nothing was built on your prediction. errorCode tells you whether it is something you can fix:
The first two are worth retrying after fixing what the message names. The third is not.
The prediction already has a power plant
The prediction already has a power plant
Nothing is replaced without your explicit consent. Either create a new prediction in the same project (a few seconds through the API) and import onto that — each design revision gets its own prediction, keeping your revision history intact — or repeat the call with
overwriteExistingPowerPlant=true to replace the existing plant and its 3D scene, the same consent the website’s import wizard collects through its confirmation dialog.The module technology is not recognized
The module technology is not recognized
PlantPredict maps the file’s module technology onto its c-Si or CdTe modeling pathway. A technology string it does not recognize fails the import rather than silently assuming crystalline silicon, because the two pathways model differently. The website’s import wizard lets you choose the family interactively.
The project is fixed-tilt
The project is fixed-tilt
Tracker designs are supported. Fixed-tilt designs are not yet supported and fail with
invalid-file.Notes
- An import is private to the account that created it. A token belonging to a different account cannot see it.
- The
jobIdis worth logging. It is the fastest way for support to find a specific import. plantandequipmentare empty until the import finishes, so readstatusfirst.- After a completed import, run the prediction as normal; the shade scene the import built contributes near-shading to the results.