@michael_vi First, thank you for the help! I was able to get this script updated here and it puts it in a alphabetical list. Thank you again import requests import json # Splunkbase API endpoint to get a list of all apps splunkbase_api_url = "https://splunkbase.splunk.com/api/v1/app/" # Initialize an empty list to store all apps all_apps = [] # Initialize offset and batch size offset = 0 batch_size = 25 # You can adjust this if needed while True: # Construct the URL with the current offset params = {"offset": offset} response = requests.get(splunkbase_api_url, params=params) if response.status_code == 200: # Parse the JSON response to access the list of apps apps = response.json() # Add the retrieved apps to the list all_apps.extend(apps['results']) # Use ['results'] to get the apps # Calculate the total number of apps from the response total_apps = apps['total'] # If we have collected all apps, break the loop if offset >= total_apps: break # Increase the offset for the next request offset += batch_size else: print("Failed to retrieve apps. Status code:", response.status_code) break # Extract 'appid' (app names) from the 'results' app_names = [app['appid'] for app in all_apps] # Sort the app names in alphabetical order app_names_sorted = sorted(app_names) # Create a dictionary with the sorted app names as a list app_data = {"app_names": app_names_sorted} # Save the app data to a JSON file as before output_file_path = "splunkbase_apps.json" with open(output_file_path, 'w') as json_file: json.dump(app_data, json_file, indent=4) # Use indent to format JSON print(f"App data has been saved to {output_file_path}")
... View more