Created
March 26, 2025 18:26
-
-
Save VinayakTiwari1103/20f653e09cf3dde5d1a56c4f07a9ef1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class OSSFuzzAPI: | |
"""A class to interact with OSS-Fuzz's API for retrieving project information.""" | |
BASE_URL = "https://oss-fuzz.com/api/v1/projects" | |
@staticmethod | |
def get_all_projects(): | |
""" | |
Fetches a list of all projects currently fuzzed by OSS-Fuzz. | |
Returns: | |
list: A JSON-formatted list of all OSS-Fuzz projects. | |
""" | |
response = requests.get(OSSFuzzAPI.BASE_URL) | |
if response.status_code == 200: | |
return response.json() | |
else: | |
return {"error": f"Failed to fetch projects. Status: {response.status_code}"} | |
# Usage Example | |
projects = OSSFuzzAPI.get_all_projects() | |
print(projects) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment