Genius Scraper

  • epctex/genius-scraper
  • Modified
  • Users 5
  • Runs 299
  • Created by Author's avatarepctex

The Genius.com scraper extracts songs and lyrics from the platform. It fetches details from song, album, artist pages, supports tag-based retrieval, searches, and includes comments. Simplify accessing and analyzing music content from Genius.com.

Pay $5.00 for 1,000 results

Genius Scraper

Pay $5.00 for 1,000 results

To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running Actors via the API in Apify Docs.

from apify_client import ApifyClient

# Initialize the ApifyClient with your API token
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchMode": "song",
    "maxItems": 20,
    "endPage": 1,
    "extendOutputFunction": "($) => { return {} }",
    "customMapFunction": "(object) => { return {...object} }",
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("epctex/genius-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)