Code Examples
Here are examples of how to interact with the API in Python, JavaScript, and cURL.
import requests
# Configuration
API_BASE = "https://www.stigviewer.com/api/v1"
TOKEN = "ss_token_app_..."
STIG_SLUG = "windows-server-2022"
# Download STIG as JSON
response = requests.get(
f"{API_BASE}/stigs/{STIG_SLUG}/download",
headers={"Authorization": f"Bearer {TOKEN}"}
)
if response.status_code == 200:
stig_data = response.json()
print(f"Downloaded {len(stig_data['groups'])} findings")
else:
print(f"Error: {response.json()}")