One popular option for accessing weather data is OpenWeatherMap. They provide a free tier that allows you to retrieve weather information based on location. Here's a general outline of the steps you can follow:
Sign up for a free account on the OpenWeatherMap website (https://openweathermap.org/) and obtain an API key.
Choose the appropriate API endpoint and parameters for retrieving weather data based on your location. You can refer to the OpenWeatherMap API documentation for specific details on how to construct the API request.
Write a function in your preferred programming language that makes a request to the OpenWeatherMap API, passing in your location and API key as parameters.
Parse the response from the API to extract the relevant weather information, such as the current weather condition.
Return the desired weather value ("cloudy" or "sunny") from your function.
Remember to handle any potential errors or exceptions that may occur during the API request or response parsing.
Please note that the specific implementation details may vary depending on the programming language or framework you are using. If you have any specific requirements or need further assistance with the implementation, please provide more details, and I'll be happy to help you further.