Open Notify simple console application I made this code in python using Open Notify API, there is something that I could improve?
Im new to coding and I'm almost 4 hours understanding and coding this program that let you interact by some inputs and it can give you information about how many people are in space now, where is the ISS now and when it will go through a given coordinate.
import requests, json, os, datetime

clear = lambda: os.system('cls')
clear ()
def peopleInSpace():
    responseAstros = requests.get(&quot;http://api.open-notify.org/astros.json&quot;)
    astros = responseAstros.json()
    people = astros['people']

    peopleInSpa = []
    for d in people:
        peopleInSpa.append(d['name'])
    print('There are', astros['number'], 'people in space, and their names are:', (', '.join(peopleInSpa)))

def issNowF():
    responseIssNow = requests.get('http://api.open-notify.org/iss-now.json')
    issNow = responseIssNow.json()

    issNowLat = issNow['iss_position']['latitude']
    issNowLon = issNow['iss_position']['longitude']
    issNowTime = issNow['timestamp']
    print('The International Space Station is right now (', datetime.datetime.fromtimestamp(issNowTime), ' GMT -3) on these approximately coordinates:', issNowLat, issNowLon)

def issNextTime():
    clear()
    lat = input(&quot;What is the latitude?&quot;)
    lon = input('What is the longitude?')
    parameters = {&quot;lat&quot;:lat, &quot;lon&quot;:lon }
    responseIssNextTime = requests.get('http://api.open-notify.org/iss-pass.json', params=parameters)
    issNextTime = responseIssNextTime.json()['response']
    risetimes = []
    for d in issNextTime:
        time = d['risetime']
        risetimes.append(time)
    times = []

    print(&quot;The next 5 times ISS is going to go through the given coordinates is:&quot;)
    for rt in risetimes:
        time = datetime.datetime.fromtimestamp(rt)
        times.append(time)
        print(time)

clear()
print('Press 1 to see how many people are in space right now')
print('Press 2 for getting the coordinates of the ISS right now')
print('Press 3 for seeing when the ISS will go through certain coordinates')
r = input('')

if r == '1':
    clear()                         
    peopleInSpace()
elif r == '2':
    clear()
    issNowF()
elif r == '3':
    clear()
    issNextTime()
else:
    clear()
    print('Please open the program again and press only 1, 2 or 3')
Cross-platform console clear
Instead of clear = lambda: os.system('cls') try to use a more cross-platform solution:
import os


def cls():
    os.system('cls' if os.name=='nt' else 'clear')

which you can then call as:
cls()

Imports
Try writing your imports on separate lines and don't forget to remove the ones you're not using:
import datetime
import os

import requests

As you can see, I've also added an extra new line between stdlib modules and 3rd party modules. It's usually a good idea to do this as it improves readability.
Naming
In Python, the name of the variables and functions should be snake_cased. Meaning, instead of def peopleInSpace() you'd have def people_in_space() and instead of responseAstros you'd have response_astros.
Spacing & line wrapping
Try to add two new-lines (instead of one) between each function and try to end your lines somewhere between 79 - 100 chars. (I usually prefer to have more than 79 chars as specified in PEP8)
Let's see how your code looks if we take into account all the above suggestions:
import datetime
import os

import requests


def cls():
    os.system('cls' if os.name=='nt' else 'clear')


def people_in_space():
    response_astros = requests.get(&quot;http://api.open-notify.org/astros.json&quot;)
    astros = response_astros.json()
    people = astros['people']

    people_in_spa = []
    for d in people:
        people_in_spa.append(d['name'])
        
    print(f'There are {astros[&quot;number&quot;]} people in space, and '
          f'their names are: {&quot;, &quot;.join(people_in_spa)}')


def iss_now_f():
    response_iss_now = requests.get('http://api.open-notify.org/iss-now.json')
    iss_now = response_iss_now.json()

    iss_now_lat = iss_now['iss_position']['latitude']
    iss_now_lon = iss_now['iss_position']['longitude']
    iss_now_time = iss_now['timestamp']
    
    print(f'The International Space Station is right now '
          f'({datetime.datetime.fromtimestamp(iss_now_time)} GMT -3) '
          f'on these approximately coordinates: {iss_now_lat} {iss_now_lon}')


def iss_next_time():
    cls()
    
    lat = input(&quot;What is the latitude?&quot;)
    lon = input('What is the longitude?')
    
    parameters = {&quot;lat&quot;:lat, &quot;lon&quot;:lon }
    response_iss_next_time = requests.get(
        'http://api.open-notify.org/iss-pass.json', params=parameters
    )
    
    iss_next_time_resp = response_iss_next_time.json()['response']
    rise_times = []
    for d in iss_next_time_resp:
        time = d['risetime']
        rise_times.append(time)
        
    times = []

    print(&quot;The next 5 times ISS is going to go through the given &quot;
          &quot;coordinates is:&quot;)
    
    for rt in rise_times:
        time = datetime.datetime.fromtimestamp(rt)
        times.append(time)
        print(time)


cls()

print('Press 1 to see how many people are in space right now')
print('Press 2 for getting the coordinates of the ISS right now')
print('Press 3 for seeing when the ISS will go through certain coordinates')

r = input('')

if r == '1':
    cls()
    people_in_space()
elif r == '2':
    cls()
    iss_now_f()
elif r == '3':
    cls()
    iss_next_time()
else:
    cls()
    print('Please open the program again and press only 1, 2 or 3')

Looks already a bit nicer, isn't it? ^_^
Now, let's focus on improvements:
In people_in_space function, we can use list comprehensions and also wrap that request call into a try / except guard so we can catch any possible request exceptions:
def people_in_space():
    try:
        response_astros = requests.get(
            &quot;http://api.open-notify.org/astros.json&quot;
        )
    except requests.exceptions.RequestException as req_exception:
        # raise an exception here or do w/e you want
        # I'm just going to exit (import sys module for this to work)
        sys.exit(f'Could not fetch people in space: {str(req_exception)}')
        
    astros = response_astros.json()
    people_in_spa = [d['name'] for d in astros['people']]

    print(f'There are {astros[&quot;number&quot;]} people in space, and '
          f'their names are: {&quot;, &quot;.join(people_in_spa)}')

The above recommendations can also be applied to iss_next_time function:
def iss_next_time():
    cls()

    lat = input(&quot;What is the latitude?&quot;)
    lon = input('What is the longitude?')

    parameters = {&quot;lat&quot;: lat, &quot;lon&quot;: lon}
    
    try:
        response_iss_next_time = requests.get(
            'http://api.open-notify.org/iss-pass.json', params=parameters
        )
    except requests.exceptions.RequestException as req_exception:
        # raise an exception here or do w/e you want
        # I'm just going to exit (import sys module for this to work)
        sys.exit(f'Could not fetch next time: {str(req_exception)}')

    iss_next_time_resp = response_iss_next_time.json()['response']
    
    print(&quot;The next 5 times ISS is going to go through the given &quot;
          &quot;coordinates is:&quot;)
    
    for item in iss_next_time_resp:
        print(datetime.datetime.fromtimestamp(item['risetime']))

I've removed the times list since you were appending things to it but didn't use it anywhere else. And I've also saved you some space complexity by directly iterating over the iss_next_time_resp.
// LE:
Even if your solution isn't bad at all, this is how I'd do it:
import datetime
import os
import sys

import requests


def clear_screen():
    &quot;&quot;&quot;
    Clear the console.
    
    Warning: on specific OSs you might need to export the 
             TERM env variable.
    
    &quot;&quot;&quot;
    
    os.system('cls' if os.name == 'nt' else 'clear')


class OpenNotify:
    &quot;&quot;&quot;
    API client wrapper for open-notify.org.
    &quot;&quot;&quot;
    
    def __init__(self):
        self.base_url = 'http://api.open-notify.org'

    def _get(self, resource, params=None):
        &quot;&quot;&quot;
        Abstract get method for all subsequent GET requests.
        
        Arguments:
            resource (str): Name of the resource.
            params (dict or None): If provided, dict of GET params.
            
        Returns:
            &lt;requests.Response&gt; object or raises exception
        &quot;&quot;&quot;
        
        url = f'{self.base_url}/{resource}'

        try:
            return requests.get(url, params=params) if params else requests.get(url)
        except requests.exceptions.RequestException as req_exception:
            print(f'Could not retrieve data at url {url} because: '
                  f'{str(req_exception)}')
            sys.exit()

    @staticmethod
    def _get_json_from_response(response, resource_item=None):
        &quot;&quot;&quot;
        Decode response to json and get a specific resource 
        item if provided.
        
        Arguments:
            response (requests.Response): The response
            resource_item (str or None): The desired resource item or None
            
        Returns:
            json object or raises an exception
        &quot;&quot;&quot;
        
        try:
            json_data = response.json()
        except ValueError as val_error:
            print(str(val_error))
            sys.exit()

        if resource_item:
            return json_data.get(resource_item)

        return json_data


    def _get_astronauts_info(self):
        &quot;&quot;&quot;
        Get astronauts information.
        
        Returns:
            json object
        &quot;&quot;&quot;
        
        response =  self._get('astros.json')
        return self._get_json_from_response(response)

    def _get_iss_data(self):
        &quot;&quot;&quot;
        Get iss data (latitude, longitude and timestamp in GMT -3).
        
        Returns:
            dict
        &quot;&quot;&quot;
        
        response = self._get('iss-now.json')
        timestamp = self._get_json_from_response(response, 'timestamp')

        return {
            'latitude': self._get_json_from_response(response, 'iss_position')['latitude'],
            'longitude': self._get_json_from_response(response, 'iss_position')['longitude'],
            'timestamp': datetime.datetime.fromtimestamp(timestamp),
        }

    def _get_iss_next_position_time(self, latitude, longitude):
        &quot;&quot;&quot;
        Get iss's next position time given the latitude 
        and longitude.
        
        Arguments:
            latitude (str): The desired latitude
            longitude (str): The desired longitude
            
        Returns:
            json object
        &quot;&quot;&quot;
        
        response = self._get(
            'iss-pass.json',
            params={'lat': latitude, 'lon': longitude}
        )
        return self._get_json_from_response(response, 'response')

    def list_astros_info(self):
        astronauts_info = self._get_astronauts_info()
        astronauts_names = &quot;, &quot;.join([item[&quot;name&quot;] for item in astronauts_info[&quot;people&quot;]])

        print(f'There are {astronauts_info[&quot;number&quot;]} people in space, and '
              f'their names are: {astronauts_names}')

    def list_iss_info(self):
        iss_info = self._get_iss_data()
        print(f'The International Space Station is right now '
              f'{iss_info[&quot;timestamp&quot;]} GMT-3 on these approximately '
              f'coordinates: lat {iss_info[&quot;latitude&quot;]} long {iss_info[&quot;longitude&quot;]}')

    def list_iss_next_position_time(self, latitude, longitude):
        iss_next_position_info = self._get_iss_next_position_time(latitude, longitude)

        print('The next 5 times ISS is going to go through the '
              'given coordinates is:')

        for item in iss_next_position_info:
            print(datetime.datetime.fromtimestamp(item['risetime']))


def main():
    print(&quot;&quot;&quot;Choose from the options below:

    1) See how many people are in space right now.
    2) Get the coordinates of the ISS right now.
    3) See when the ISS will go through certain coordinates.

    q) Exit
    &quot;&quot;&quot;)

    user_input = input('Please choose an option: ')

    open_notify = OpenNotify()

    if user_input == '1':
        clear_screen()
        open_notify.list_astros_info()
    elif user_input == '2':
        clear_screen()
        open_notify.list_iss_info()
    elif user_input == '3':
        clear_screen()

        latitude = input('Please enter the latitude: ')
        longitude = input('Please enter the longitude: ')

        open_notify.list_iss_next_position_time(latitude, longitude)
    else:
        print('Invalid option')
        sys.exit()


if __name__ == '__main__':
    main()

A few things to think about:

There's still room for improvements in regards to user input validation;
The retrieved API data can change and there're no sanity checks against this;
The menu can be dynamically created in order to avoid hardcoding future next options;
The OpenNotify class might be a bit redundant since we're not making changes to any specific state variables but as the API grows and you want to add other functionality to it...this might become helpful.