<jupyter_start><jupyter_text>Asteroids - NeoWs NeoWs (Near Earth Object Web Service) is a RESTful web service for near earth Asteroid information  USING NASA NEOWS API TO EXTRACT LINKS , NUMBER OF ELEMENTS PASSED ,NEAR EARTH OBJECT LIKE INFORMATIONS.<jupyter_code>#importing libraries
import requests
from datetime import date, timedelta
import os
import urllib.request


#this api gives data of last 7 days so difference between starting and ending date must be of 7. 
start_date = date(2020, 7, 21)
end_date = date(2020, 7, 28)  

# store NASA API KEY to 'key' 
key = '<KEY>'

#pass the parameter required for api.
params = {'start_date': start_date , 'end_date': end_date , 'api_key': key }

#get the request from nasa api server.
r = requests.get('https://api.nasa.gov/neo/rest/v1/feed?', params= params)    

#store data in .json file.
r = r.json()

#print the starting date and ending date.
print("STARTING DATE:",start_date)
print("ENDING DATE:  ",end_date)

#print new blank line.
print()

print("DETAIL LINKS INFORMATION:")
print("'next' for next 7 days")
print("'prev' for previous 7 days")
print("'self' for current 7 days")
print()

#printing the links
print("",r['links'])
print()

#number of element passed in 7 days.
print("NUMBER OF ELEMENT PASSED->",r['element_count'])
print()

#printing information about near earth objects. 
print("",r['near_earth_objects'])

#printing 80 stars.
print('*'*80)



# the metadata to extract from api.
r.keys()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11804158283031523, 'fraction_numerical': 0.01676727028839705, 'mean_word_length': 4.991967871485944, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '75460', 'license': 'MIT', 'n_tokens_mistral': 532, 'n_tokens_neox': 488, 'n_words': 183, 'path': 'Neows_Scrap.ipynb', 'repo_name': 'prateek-code-22/NASA-Scrapped-data', 'size': '1526'}