A lightweight, modern Swift library for scraping app icons and screenshots from the Apple App Store.
- 🚀 Asynchronous API: Uses modern Swift
async/awaitfor network calls. - 📦 Zero Dependencies: Pure Swift implementation using Foundation.
- 📱 Multi-Platform Support: Extract assets for iPhone, iPad, Mac, Apple Watch, Apple TV, and Vision Pro.
- 🛠️ Robust Parsing: Implements a dual parsing strategy—primary JSON data extraction with a regex-based DOM fallback.
- 🖼️ Asset Metadata: Retrieves image URLs along with their native width and height.
- macOS 14.0+
- iOS 16.0+
- Swift 6.0+
Add the following dependency to your Package.swift:
dependencies: [
.package(url: "https://github.com/RanduSoft/RSAppStoreScraper.git", from: "1.1.0")
]Or add it directly in Xcode via File > Add Packages.
import AppStoreScraper
let scraper = AppStoreScraper()
do {
// Replace with a valid App Store ID
let media = try await scraper.fetchMedia(forAppID: "1497748716")
// Access the App Icon
if let icon = media.icon {
print("Icon URL: \(icon.url)")
}
// Access Screenshots by Platform
for (platform, screenshots) in media.screenshots {
print("--- \(platform.rawValue) ---")
for screenshot in screenshots {
print("Screenshot: \(screenshot.url) (\(screenshot.width)x\(screenshot.height))")
}
}
} catch {
print("Failed to fetch media: \(error)")
}The library fetches the public App Store product page and attempts to:
- Locate and parse the
serialized-server-dataJSON script tag (most reliable). - Fallback to parsing the HTML DOM using optimized Regular Expressions if the JSON structure is unavailable or changes.
Everything in this repository was built 100% by AI, using Google Gemini 3 Pro.
This project is available under the MIT License.