### Install Laravel Open Holidays API via Composer Source: https://github.com/noahnxt/laravel-open-holidays-api/blob/main/README.md This command installs the Laravel Open Holidays API package using Composer, the dependency manager for PHP. Ensure Composer is installed and accessible in your terminal. ```bash composer require noahnxt/laravel-open-holiday-api ``` -------------------------------- ### Get Countries Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves a list of supported countries for a given language. ```APIDOC ## GET /regional/countries ### Description Retrieves a list of supported countries for a given language. ### Method GET ### Endpoint /regional/countries ### Parameters #### Query Parameters - **languageIsoCode** (string) - Required - ISO 639-1 language code. ### Request Example ```php countries('EN'); ``` ### Response #### Success Response (200) - **iso** (string) - The ISO 3166-1 country code. - **name** (string) - The name of the country. - **currency** (string) - The currency used in the country. - **capital** (string) - The capital city of the country. - **iso3** (string) - The ISO 3166-3 country code. - **phonecode** (string) - The international dialing code for the country. - **continent** (string) - The continent the country belongs to. - **languages** (array) - An array of supported language codes. - **subdivisions** (array) - An array of supported subdivision codes. #### Response Example ```json [ { "iso": "US", "name": "United States", "currency": "USD", "capital": "Washington, D.C.", "iso3": "USA", "phonecode": "1", "continent": "North America", "languages": ["EN"], "subdivisions": ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"] } ] ``` ``` -------------------------------- ### Get Supported Languages Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves a list of all languages supported by the API for localizing response data. The names of the languages themselves can be requested in a specified language. ```php regional()->languages( languageIsoCode: 'EN' // Language for response names ); $languages = $response->json(); // List available languages foreach ($languages as $language) { echo $language['isoCode'] . ': ' . $language['name'][0]['text'] . "\n"; } // Example output: // EN: English // DE: German // FR: French // NL: Dutch // ... ``` -------------------------------- ### Get Public Holidays Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves a list of public holidays for a given country and language, within a specified date range. ```APIDOC ## GET /holidays/public ### Description Retrieves a list of public holidays for a given country and language, within a specified date range. ### Method GET ### Endpoint /holidays/public ### Parameters #### Query Parameters - **countryIsoCode** (string) - Required - ISO 3166-1 country code. - **languageIsoCode** (string) - Required - ISO 639-1 language code. - **startDate** (string) - Required - The start date for the holiday search (YYYY-MM-DD). - **endDate** (string) - Required - The end date for the holiday search (YYYY-MM-DD). - **subdivisionCode** (string) - Optional - Subdivision code or empty. ### Request Example ```php publicHolidays( 'US', 'EN', '2024-01-01', '2024-12-31', '' ); ``` ### Response #### Success Response (200) - **date** (string) - The date of the holiday (YYYY-MM-DD). - **name** (string) - The name of the holiday. - **country** (string) - The country where the holiday is observed. - **isofficial** (boolean) - Indicates if the holiday is official. - **isworkingday** (boolean) - Indicates if the day is a working day. - **type** (string) - The type of holiday (e.g., 'Public', 'School'). - **subdivision** (string) - The subdivision where the holiday is observed. #### Response Example ```json [ { "date": "2024-01-01", "name": "New Year's Day", "country": "US", "isofficial": true, "isworkingday": false, "type": "Public", "subdivision": "" } ] ``` ``` -------------------------------- ### Get Public Holiday Statistics Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves statistical data about public holidays for a country, showing coverage periods and available data ranges. ```APIDOC ## GET /statistics/public-holidays ### Description Returns statistical data about public holidays for a country, showing coverage periods and available data ranges. ### Method GET ### Endpoint /statistics/public-holidays ### Parameters #### Query Parameters - **countryIsoCode** (string) - Required - ISO 3166-1 country code. - **subdivisionCode** (string) - Optional - Subdivision code or empty. ### Request Example ```php statisticsPublicHolidays('FR', ''); ``` ### Response #### Success Response (200) - **startYear** (integer) - The starting year of the available data. - **endYear** (integer) - The ending year of the available data. #### Response Example ```json { "startYear": 2010, "endYear": 2030 } ``` ``` -------------------------------- ### Get Supported Countries Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Fetches a list of all countries supported by the API. The response can be localized to a specified language. This is useful for populating country selection fields or for validating country codes. ```php regional()->countries( languageIsoCode: 'EN' // ISO 639-1 language code for response ); $countries = $response->json(); // Example: List all supported countries foreach ($countries as $country) { echo $country['isoCode'] . ': ' . $country['name'][0]['text'] . "\n"; } // Get countries with names in German $germanCountries = $holidayApi->regional()->countries('DE'); // Expected response structure: // [ // { // "isoCode": "DE", // "name": [{"language": "EN", "text": "Germany"}], // "officialLanguages": ["DE"] // }, // ... // ] ``` -------------------------------- ### Get Subdivisions by Country Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Fetches administrative subdivisions (like states or provinces) for a given country. This is crucial for countries where holidays might differ regionally. Requires country ISO code and desired response language. ```php regional()->subdivisions( countryIsoCode: 'DE', // ISO 3166-1 country code languageIsoCode: 'EN' // Response language ); $subdivisions = $response->json(); // List all German subdivisions foreach ($subdivisions as $subdivision) { echo $subdivision['code'] . ': ' . $subdivision['name'][0]['text'] . "\n"; } // Output: DE-BY: Bavaria, DE-BE: Berlin, DE-NW: North Rhine-Westphalia, ... // Get Belgian subdivisions $belgianSubdivisions = $holidayApi->regional()->subdivisions('BE', 'EN'); // Get Swiss cantons $swissCantons = $holidayApi->regional()->subdivisions('CH', 'EN'); ``` -------------------------------- ### Get School Holidays By Date Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves school holidays from all countries for a specific date. This is useful for checking which countries have school holidays on a particular day. ```APIDOC ## GET /holidays/schoolHolidaysByDate ### Description Returns school holidays from all countries for a specific date. Useful for checking which countries have school holidays on a particular day. ### Method GET ### Endpoint /holidays/schoolHolidaysByDate ### Parameters #### Query Parameters - **languageIsoCode** (string) - Required - ISO 639-1 language code for the response language. - **date** (string) - Required - The date to query for school holidays (YYYY-MM-DD format). ### Request Example ```php holidays()->schoolHolidaysByDate( languageIsoCode: 'EN', date: '2024-08-15' ); $schoolHolidays = $response->json(); ``` ### Response #### Success Response (200) - **Array of holiday objects**, where each object contains: - **country**: Object with country details (isoCode, name). - **name**: Array of localized holiday names. - **startDate**: The start date of the holiday. - **endDate**: The end date of the holiday. - **type**: The type of holiday (e.g., 'school'). #### Response Example ```json [ { "country": {"isoCode": "US", "name": [{"language": "EN", "text": "United States"}]}, "name": [{"language": "EN", "text": "Summer Break"}], "startDate": "2024-06-01", "endDate": "2024-08-31", "type": "school" } ] ``` ``` -------------------------------- ### Get School Holiday Statistics Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves statistical data about school holidays for a specified country, including coverage periods and available data ranges. ```APIDOC ## GET /statistics/school-holidays ### Description Returns statistical data about school holidays for a country, showing coverage periods and available data ranges. ### Method GET ### Endpoint /statistics/school-holidays ### Parameters #### Query Parameters - **countryIsoCode** (string) - Required - ISO 3166-1 country code. - **subdivisionCode** (string) - Optional - Subdivision code or empty. ### Request Example ```php statistics()->statisticsSchoolHolidays( countryIsoCode: 'NL', subdivisionCode: '' ); $stats = $response->json(); ``` ### Response #### Success Response (200) - **startYear** (integer) - The starting year of the available data. - **endYear** (integer) - The ending year of the available data. #### Response Example ```json { "startYear": 2020, "endYear": 2025 } ``` ``` -------------------------------- ### Get School Holiday Statistics Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves statistical data for school holidays for a specified country. It shows coverage periods and available data ranges. Requires the OpenHolidaysApi class. ```php statistics()->statisticsSchoolHolidays( countryIsoCode: 'NL', // ISO 3166-1 country code subdivisionCode: '' // Subdivision code or empty ); $stats = $response->json(); // Get statistics for Belgian Flanders $flandersStats = $holidayApi->statistics()->statisticsSchoolHolidays( countryIsoCode: 'BE', subdivisionCode: 'NL-BE' ); // Example: Check data availability if ($response->successful()) { echo "School Holiday Data Coverage:\n"; echo "From: " . $stats['startYear'] . "\n"; echo "To: " . $stats['endYear'] . "\n"; } ``` -------------------------------- ### Holidays Resource - Get Public Holidays By Date Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves public holidays from all countries for a specific date. This is useful for checking which countries have holidays on a particular day. ```APIDOC ## GET /holidays/public/by-date ### Description Returns public holidays from all countries for a specific date. Useful for checking which countries have holidays on a particular day. ### Method GET ### Endpoint /holidays/public/by-date ### Parameters #### Query Parameters - **languageIsoCode** (string) - Required - Response language (ISO 639-1) - **date** (string) - Required - Date to query (YYYY-MM-DD) ### Request Example ```php holidays()->publicHolidaysByDate( languageIsoCode: 'EN', date: '2024-12-25' ); ``` ### Response #### Success Response (200) - **country** (object) - Information about the country where the holiday occurs. - **name** (array) - Array of holiday names with text and language codes. - **startDate** (string) - The start date of the holiday (YYYY-MM-DD). - **endDate** (string) - The end date of the holiday (YYYY-MM-DD). - **type** (string) - The type of holiday (e.g., 'public'). #### Response Example ```json [ { "country": { "isoCode": "US", "name": "United States" }, "name": [ { "lang": "EN", "text": "Christmas Day" } ], "startDate": "2024-12-25", "endDate": "2024-12-25", "type": "public" } ] ``` ``` -------------------------------- ### Get School Holidays by Date Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves school holidays for all countries on a specific date. Requires specifying the response language and the date. Useful for identifying holidays during specific periods like summer or Christmas breaks. ```php holidays()->schoolHolidaysByDate( languageIsoCode: 'EN', // Response language date: '2024-08-15' // Date to query (summer vacation period) ); $schoolHolidays = $response->json(); // Example: Check school holidays during Christmas break $christmasHolidays = $holidayApi->holidays()->schoolHolidaysByDate( languageIsoCode: 'EN', date: '2024-12-26' ); if ($christmasHolidays->successful()) { echo "Countries with school holidays on Dec 26:\n"; foreach ($christmasHolidays->json() as $holiday) { echo "- " . $holiday['country']['isoCode'] . ": " . $holiday['name'][0]['text'] . "\n"; } } ``` -------------------------------- ### Holidays Resource - Get Public Holidays Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves a list of public holidays for a specified country within a given date range. It allows filtering by language and administrative subdivision. ```APIDOC ## GET /holidays/public ### Description Returns a list of public holidays for a specific country within a date range. Supports filtering by language and subdivision for regional holidays. ### Method GET ### Endpoint /holidays/public ### Parameters #### Query Parameters - **countryIsoCode** (string) - Required - ISO 3166-1 country code - **languageIsoCode** (string) - Required - ISO 639-1 language code - **validFrom** (string) - Required - Start date (YYYY-MM-DD) - **validTo** (string) - Required - End date (YYYY-MM-DD) - **subdivisionCode** (string) - Optional - Subdivision code or empty string ### Request Example ```php holidays()->publicHolidays( countryIsoCode: 'BE', languageIsoCode: 'NL', validFrom: '2024-01-01', validTo: '2024-12-31', subdivisionCode: '' ); ``` ### Response #### Success Response (200) - **name** (array) - Array of holiday names with text and language codes. - **startDate** (string) - The start date of the holiday (YYYY-MM-DD). - **endDate** (string) - The end date of the holiday (YYYY-MM-DD). - **type** (string) - The type of holiday (e.g., 'public'). - **country** (object) - Information about the country. - **subdivision** (object) - Information about the subdivision, if applicable. #### Response Example ```json [ { "name": [ { "lang": "NL", "text": "Nieuwjaarsdag" } ], "startDate": "2024-01-01", "endDate": "2024-01-01", "type": "public", "country": { "isoCode": "BE", "name": "Belgium" }, "subdivision": null } ] ``` ``` -------------------------------- ### Fetch School Holidays by Country and Date Range (PHP) Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Fetches official school holidays for a specific country within a date range. Supports filtering by subdivision for regional school calendars. Requires country ISO code, language ISO code, start date, and end date. ```php holidays()->schoolHolidays( countryIsoCode: 'NL', // ISO 3166-1 country code languageIsoCode: 'NL', // ISO 639-1 language code validFrom: '2024-01-01', // Start date validTo: '2024-12-31', // End date subdivisionCode: '' // Subdivision code or empty ); $schoolHolidays = $response->json(); // Example: Get Belgian school holidays for Flanders (NL-BE) $flemishHolidays = $holidayApi->holidays()->schoolHolidays( countryIsoCode: 'BE', languageIsoCode: 'NL', validFrom: '2024-01-01', validTo: '2024-12-31', subdivisionCode: 'NL-BE' // Flemish community ); foreach ($flemishHolidays->json() as $holiday) { echo $holiday['name'][0]['text'] . ': '; echo $holiday['startDate'] . ' to ' . $holiday['endDate'] . "\n"; } ``` -------------------------------- ### Fetch Public Holidays by Country and Date Range (PHP) Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Fetches public holidays for a specified country within a given date range. Supports filtering by language and subdivision. Requires country ISO code, language ISO code, start date, and end date. ```php holidays()->publicHolidays( countryIsoCode: 'BE', // ISO 3166-1 country code languageIsoCode: 'NL', // ISO 639-1 language code validFrom: '2024-01-01', // Start date (YYYY-MM-DD) validTo: '2024-12-31', // End date (YYYY-MM-DD) subdivisionCode: '' // Subdivision code or empty string ); // Access response data $holidays = $response->json(); // Example: Get German holidays for Bavaria (BY) subdivision $germanHolidays = $holidayApi->holidays()->publicHolidays( countryIsoCode: 'DE', languageIsoCode: 'DE', validFrom: '2024-01-01', validTo: '2024-12-31', subdivisionCode: 'DE-BY' // Bavaria subdivision code ); // Check if request was successful if ($response->successful()) { foreach ($response->json() as $holiday) { echo $holiday['name'][0]['text'] . ' - ' . $holiday['startDate'] . "\n"; } } ``` -------------------------------- ### Holidays Resource - Get School Holidays Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves official school holidays for a specified country within a date range. It supports filtering by subdivision for countries with regional school calendars. ```APIDOC ## GET /holidays/school ### Description Returns official school holidays for a specific country within a date range. Supports subdivision filtering for countries with regional school calendars. ### Method GET ### Endpoint /holidays/school ### Parameters #### Query Parameters - **countryIsoCode** (string) - Required - ISO 3166-1 country code - **languageIsoCode** (string) - Required - ISO 639-1 language code - **validFrom** (string) - Required - Start date (YYYY-MM-DD) - **validTo** (string) - Required - End date (YYYY-MM-DD) - **subdivisionCode** (string) - Optional - Subdivision code or empty string ### Request Example ```php holidays()->schoolHolidays( countryIsoCode: 'NL', languageIsoCode: 'NL', validFrom: '2024-01-01', validTo: '2024-12-31', subdivisionCode: '' ); ``` ### Response #### Success Response (200) - **name** (array) - Array of holiday names with text and language codes. - **startDate** (string) - The start date of the holiday (YYYY-MM-DD). - **endDate** (string) - The end date of the holiday (YYYY-MM-DD). - **type** (string) - The type of holiday (e.g., 'school'). - **country** (object) - Information about the country. - **subdivision** (object) - Information about the subdivision, if applicable. #### Response Example ```json [ { "name": [ { "lang": "NL", "text": "Kerstvakantie" } ], "startDate": "2024-12-23", "endDate": "2025-01-05", "type": "school", "country": { "isoCode": "NL", "name": "Netherlands" }, "subdivision": null } ] ``` ``` -------------------------------- ### Get Public Holiday Statistics Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves statistical data for public holidays in a specified country or subdivision. It includes information like the total number of holidays and the years for which data is available. Useful for analyzing holiday patterns. ```php statistics()->statisticsPublicHolidays( countryIsoCode: 'DE', // ISO 3166-1 country code subdivisionCode: '' // Subdivision code or empty for national ); $stats = $response->json(); // Get statistics for a specific subdivision (Bavaria) $bavariaStats = $holidayApi->statistics()->statisticsPublicHolidays( countryIsoCode: 'DE', subdivisionCode: 'DE-BY' ); // Example: Display holiday statistics if ($response->successful()) { echo "Public Holiday Statistics:\n"; echo "Country: " . $stats['country']['isoCode'] . "\n"; echo "Coverage: " . $stats['startYear'] . " - " . $stats['endYear'] . "\n"; } ``` -------------------------------- ### Fetch Public Holidays using Laravel Open Holidays API Source: https://github.com/noahnxt/laravel-open-holidays-api/blob/main/README.md This PHP code snippet demonstrates how to instantiate the OpenHolidaysApi client and retrieve public holidays. It requires country codes, a start date, an end date, and an optional region identifier as input. ```php $holidayApi = new \NoahNxT\LaravelOpenHolidaysApi\OpenHolidaysApi(); $holidays = $holidayApi ->holidays() ->publicHolidays( 'BE', 'NL', '2023-01-01', '2023-12-31', 'NL-BE' ); ``` -------------------------------- ### Using the Laravel Facade for API Access Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Demonstrates how to use the provided Laravel Facade for convenient static access to the Open Holidays API. This simplifies making requests without direct instantiation. ```php publicHolidays( 'US', 'EN', '2024-01-01', '2024-12-31', '' ); $countries = LaravelOpenHolidayApi::regional()->countries('EN'); $stats = LaravelOpenHolidayApi::statistics()->statisticsPublicHolidays('FR', ''); ``` -------------------------------- ### Initialize OpenHolidaysApi Client in Laravel Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Demonstrates how to create an instance of the OpenHolidaysApi client within a Laravel application. The package auto-registers its service provider, allowing direct instantiation and access to its resource methods. ```php holidays(); $regional = $holidayApi->regional(); $statistics = $holidayApi->statistics(); ``` -------------------------------- ### Error Handling with Saloon Responses Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Illustrates how to handle API responses and potential errors using Saloon's built-in response methods. This includes checking for successful responses, handling failures, and catching exceptions. ```php holidays()->publicHolidays( 'DE', 'EN', '2024-01-01', '2024-12-31', '' ); // Check response status if ($response->successful()) { $holidays = $response->json(); // Process holidays... } elseif ($response->failed()) { // Handle failure echo "Request failed with status: " . $response->status(); } // Alternative: throw exception on failure $response->throw(); } catch (RequestException $e) { // Handle request exception echo "API Error: " . $e->getMessage(); } ``` -------------------------------- ### Run Tests for Laravel Open Holidays API Source: https://github.com/noahnxt/laravel-open-holidays-api/blob/main/README.md This command executes the test suite for the Laravel Open Holidays API package using Composer. It's essential for verifying the package's functionality and ensuring no regressions have been introduced. ```bash composer test ``` -------------------------------- ### Statistics Resource Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Endpoint for retrieving statistical data about public holidays for a country. ```APIDOC ## GET /statistics/publicHolidays ### Description Returns statistical data about public holidays for a country, including total counts and coverage years. ### Method GET ### Endpoint /statistics/publicHolidays ### Parameters #### Query Parameters - **countryIsoCode** (string) - Required - ISO 3166-1 alpha-2 country code for which to retrieve statistics. - **subdivisionCode** (string) - Optional - Subdivision code (e.g., 'DE-BY') for which to retrieve statistics. If empty or omitted, national statistics are returned. ### Request Example ```php statistics()->statisticsPublicHolidays( countryIsoCode: 'DE', subdivisionCode: '' ); $stats = $response->json(); ``` ### Response #### Success Response (200) - **Object containing public holiday statistics**, including: - **country**: Object with country details (isoCode, name). - **subdivision**: Object with subdivision details (code, name), if applicable. - **totalHolidays** (integer): Total number of public holidays. - **startYear** (integer): The earliest year for which data is available. - **endYear** (integer): The latest year for which data is available. #### Response Example ```json { "country": {"isoCode": "DE", "name": [{"language": "EN", "text": "Germany"}]}, "subdivision": null, "totalHolidays": 10, "startYear": 1900, "endYear": 2025 } ``` ``` -------------------------------- ### Fetch Public Holidays by Date Worldwide (PHP) Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Retrieves public holidays from all countries for a specific date. This is useful for identifying holidays occurring on a particular day globally. Requires language ISO code and the date. ```php holidays()->publicHolidaysByDate( languageIsoCode: 'EN', // Response language date: '2024-12-25' // Date to query (YYYY-MM-DD) ); $holidays = $response->json(); // Example: Check holidays on New Year's Day $newYearHolidays = $holidayApi->holidays()->publicHolidaysByDate( languageIsoCode: 'EN', date: '2024-01-01' ); foreach ($newYearHolidays->json() as $holiday) { echo $holiday['country']['isoCode'] . ': ' . $holiday['name'][0]['text'] . "\n"; } ``` -------------------------------- ### Regional Resource Source: https://context7.com/noahnxt/laravel-open-holidays-api/llms.txt Endpoints for retrieving regional information such as supported countries, languages, and administrative subdivisions. ```APIDOC ## GET /regional/countries ### Description Returns a list of all countries supported by the Open Holidays API. ### Method GET ### Endpoint /regional/countries ### Parameters #### Query Parameters - **languageIsoCode** (string) - Optional - ISO 639-1 language code for the names of the countries in the response. Defaults to English if not provided. ### Request Example ```php regional()->countries(languageIsoCode: 'EN'); $countries = $response->json(); ``` ### Response #### Success Response (200) - **Array of country objects**, where each object contains: - **isoCode** (string): The ISO 3166-1 alpha-2 country code. - **name** (Array): Localized names of the country. - **officialLanguages** (Array): Array of ISO 639-1 language codes for the official languages of the country. #### Response Example ```json [ { "isoCode": "DE", "name": [{"language": "EN", "text": "Germany"}], "officialLanguages": ["DE"] } ] ``` ## GET /regional/languages ### Description Returns a list of all languages supported by the API for response localization. ### Method GET ### Endpoint /regional/languages ### Parameters #### Query Parameters - **languageIsoCode** (string) - Optional - ISO 639-1 language code for the names of the languages in the response. Defaults to English if not provided. ### Request Example ```php regional()->languages(languageIsoCode: 'EN'); $languages = $response->json(); ``` ### Response #### Success Response (200) - **Array of language objects**, where each object contains: - **isoCode** (string): The ISO 639-1 language code. - **name** (Array): Localized names of the language. #### Response Example ```json [ {"isoCode": "EN", "name": [{"language": "EN", "text": "English"}]}, {"isoCode": "DE", "name": [{"language": "EN", "text": "German"}]} ] ``` ## GET /regional/subdivisions ### Description Returns administrative subdivisions (states, provinces, regions) for a specific country. Essential for countries where holidays vary by region. ### Method GET ### Endpoint /regional/subdivisions ### Parameters #### Query Parameters - **countryIsoCode** (string) - Required - ISO 3166-1 alpha-2 country code for which to retrieve subdivisions. - **languageIsoCode** (string) - Optional - ISO 639-1 language code for the names of the subdivisions in the response. Defaults to English if not provided. ### Request Example ```php regional()->subdivisions( countryIsoCode: 'DE', languageIsoCode: 'EN' ); $subdivisions = $response->json(); ``` ### Response #### Success Response (200) - **Array of subdivision objects**, where each object contains: - **code** (string): The code of the subdivision. - **name** (Array): Localized names of the subdivision. #### Response Example ```json [ {"code": "DE-BY", "name": [{"language": "EN", "text": "Bavaria"}]}, {"code": "DE-BE", "name": [{"language": "EN", "text": "Berlin"}]} ] ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.