π§© Script Endpoints
Each script on Fuyu has its own API endpoint, allowing you to programmatically fetch the latest results.
This is useful when you want to treat a script like a microservice β trigger it on a schedule or fetch its output on demand.
π₯ Getting Results for a Scriptβ
Each script has a unique ID. You can retrieve its latest result with:
GET /api/scripts/:id/results
Example:
curl "https://fuyu.gg/api/scripts/abc123/results?includeStats=true" \
-H "x-api-key: api_abc123.xyz456"
π Response Exampleβ
{
"data": [
{
"title": "German and U.K. Leaders Sign Mutual Defense Pact as U.S. Steps Back",
"content": "The new treaty includes a pledge by both countries to regard a threat against one as a threat against the other..."
},
{
"title": "The U.K. Plans to Lower the Voting Age to 16. Hereβs What to Know.",
"content": "The plan has been described as the largest expansion of voting rights in Britain in decades."
}
],
"execution": {
"started_at": "2025-07-18T02:02:12.708Z",
"finished_at": "2025-07-18T02:02:32.976Z",
"duration": 20,
"cost": 38,
"status": "success"
}
}
βοΈ Optional Query Parametersβ
-
?includeFailed=true
Returns the latest job results even if the job failed. This may include partial data. -
?includeStats=true
Appends basic run statistics to the response:{
"total_runs": 48,
"successful_runs": 36,
"failed_runs": 12
}
π Use Casesβ
- Trigger a script via internal automation and fetch output from the endpoint
- Periodically pull the latest scrape value for a product
- Integrate results directly into dashboards or spreadsheets
π Access Controlβ
Only the scriptβs owner (or authorized team members) can use this endpoint. Make sure your API key has access to the script.