Skip to content

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

  • nutbagnutbag US
    edited March 12
    As a practical example, I envision using an API like this in Python:

    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
    )

    This would greatly streamline my automated workflow and eliminate the need for manual intervention or complex GUI automation scripts.




  • nutbagnutbag US
    edited March 12
    sorry posted in the wrong section. Guess the label "FEATURE REQUESTS" didnt click with me .... :#
  • cherubcherub SERnuke.com
    Just a simple script to append your urls to your project .new_targets files will do. They're located in C:\Users\xxxx\AppData\Roaming\GSA Search Engine Ranker\projects, and are lists of urls for each project to target next.
    Thanked by 1nutbag
  • O WOW. THANK YOU. I really didnt know that. Much appreciated
  • i guess the files i want to append are the .target/.target2 etc ...
  • cherubcherub SERnuke.com
    You can use the .targets file also, I've just always gone for the .new_targets files.
    Thanked by 1nutbag
  • thank you, i got it working
Sign In or Register to comment.