# runSimulation **Endpoint:** `POST https://firesim.cs.gsu.edu/api/runSimulation` Runs the simulation for one time interval and returns all fire events that occurred. Use `continueSimulation` instead when you want to sample results at multiple intervals. ## Parameters | Name | Type | Required | Default | Description | |------|------|----------|---------|-------------| | `userToken` | string | yes | — | Your simulation token. | | `time` | integer | yes | — | Number of timesteps to run. Must be greater than 0. | ## Responses ### HTTP 200 List of fire events that occurred during the simulation interval. An empty array means the computed fire perimeter is empty, which typically indicates a backend error or a misconfigured API call. **Example:** ```json [ { "x": "25", "y": "25", "Operation": "BurnTeam", "time": "0.0" } ] ``` ### HTTP 400 Bad request. Returned when `time` is not a valid integer (e.g. `time=abc`). **Example:** ```json "" ``` ### HTTP 500 Internal server error (Spring JSON). Returned when `userToken` is missing or invalid — the server cannot locate the simulation instance for that token. **Example:** ```json { "timestamp": "2026-05-20T16:41:19.716+00:00", "status": 500, "error": "Internal Server Error", "path": "/api/runSimulation" } ``` ## Examples ### Python ```python import requests base_url: str = "https://firesim.cs.gsu.edu/api/runSimulation/" params: dict[str, int | str] = { "userToken": "abc123xyz", "time": 50, } response = requests.post(base_url, params=params) print(response.text) ``` ### JavaScript ```javascript /** @type {string} */ const BASE_URL = "https://firesim.cs.gsu.edu/api/runSimulation/"; const params = { userToken: "abc123xyz", time: 50, }; const url = new URL(BASE_URL); Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v)); fetch(url.toString(), { method: "POST" }) .then(res => res.text()) .then(console.log); ``` ### cURL ```bash BASE_URL="https://firesim.cs.gsu.edu/api/runSimulation/" curl -s -X POST \ -G --data-urlencode "userToken=abc123xyz" \ -G --data-urlencode "time=50" \ "$BASE_URL" ``` ### Java ```java import java.net.URI; import java.net.http.*; String BASE_URL = "https://firesim.cs.gsu.edu/api/runSimulation/"; String queryString = "userToken=abc123xyz" + "&" + "time=50"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(BASE_URL + "?" + queryString)) .POST(HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); ``` ### Go ```go import ( "fmt" "io" "net/http" "net/url" ) baseURL := "https://firesim.cs.gsu.edu/api/runSimulation/" params := url.Values{} params.Set("userToken", "abc123xyz") params.Set("time", "50") resp, _ := http.PostForm(baseURL, params) defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) ``` ### Rust ```rust use reqwest::blocking::Client; let base_url = "https://firesim.cs.gsu.edu/api/runSimulation/"; let params = vec![ ("userToken", "abc123xyz"), ("time", "50"), ]; let client = Client::new(); let response = client.post(base_url).query(¶ms).send().unwrap(); println!("{}", response.text().unwrap()); ```