API for importing target urls
I'm currently using GSA Search Engine Ranker and have automated my URL scraping process. However, I'm looking for a way to automate the import of target URLs into GSA without manual intervention.
Would it be possible to add an API or command-line parameter that allows programmatic importing of target URLs?
This would be extremely helpful for users who need to automate their workflow.
Specifically, I'm hoping for something like:
1. A command-line parameter (e.g., /importtargets:"path\to\file.txt")
2. A simple API that can be called from external scripts
3. Or even a designated "hot folder" that GSA automatically monitors for new URL files
This would save significant time for users who regularly import large URL lists from external sources.
Thank you for considering this feature request!
Comments
import requests # or some GSA-specific library
# Connect to GSA (locally running or remote)
gsa = GSASearchEngineRanker("localhost", port=12345, api_key="my_api_key")
# Import targets from a file
result = gsa.import_targets_from_file("C:/path/to/my_urls.txt")
print(f"Imported {result['count']} URLs successfully")
# Or import targets directly as a list
urls = [
"https://example1.com",
"https://example2.com",
"https://example3.com"
]
result = gsa.import_targets(urls)
print(f"Imported {result['count']} URLs successfully")
# Optionally, specify a project or category
result = gsa.import_targets_from_file(
"C:/path/to/my_urls.txt",
project="MyProject",
target_type="blogs" # For categorizing URLs
)