This endpoint provides a simple, case-insensitive search mechanism to look up time zone details (Continent, Town, and UTC offset) based on a single search term: the City/Town name.
| Detail | Value |
|---|---|
| URL | /wc |
| Method | POST |
| Accepts | application/json |
The endpoint requires a JSON object containing the city or town name to search for. The value is automatically capitalized for the search (e.g., "new york" becomes "New york").
| Key | Type | Description |
|---|---|---|
city |
string |
The town name to search in the CSV's town column. |
Example Request (JSON):
{
"city": "Alaska"
}
The endpoint returns a JSON object with a status and message.
If one or more matches are found, the endpoint returns details of the first match it encounters.
| Key | Type | Description |
|---|---|---|
status |
string |
"Success" |
message |
string |
Continent,Town,UTC offset (STD) of the first matching row. |
Example Success Response:
{
"Date and day": "2025-10-29 (Wednesday)",
"Time:": "23:55:32",
"Week number:": "44",
"message": "United States,Alaska,UTC-8",
"status": "Success"
}
| HTTP Code | Status Key | Message Description | Cause |
|---|---|---|---|
| 200 OK | "Failed" | "No matching time zones found." | The CSV file was opened successfully, but no row matched the provided city name. |
| 400 Bad Request | (N/A) | "Request must be JSON" | The request was not sent with Content-Type: application/json. |
| 500 Internal Error | "Failed" | "Error: File not found at 'iana\_timezones.csv'." | The required CSV file is missing from the working directory. |
| 500 Internal Error | "Failed" | "An error occurred during file reading: [Error Details]" | An unexpected error occurred while processing the CSV file (e.g., incorrect format, encoding issue). |