• First I will describe how I’ve done this, and from there you will understand what I’m really trying to do.

    – Goal –
    I’m creating a scraper that will run automatically and also be triggered to run via theme pages that are private.

    – How I implement manual trigger –
    The entire script that does all the scraping and saving is in a single file and saved inside the theme files. The theme files make a post request with js, and the endpoint is the actual file in theme. The file it’s self checks the type of post request, and takes the params, and goes on processing what it needs to.

    – Intention –
    I want to move all this into a plugin so it’s not so hacky, and I want to create a legit endpoint that can be liked to with something more like ‘domain.com/api/entitiy_id’, rather than ‘domain.com/wp-content/themes/theme_name/inc/scraper.php?param_name=blah’

    How can I create that endpoint to do this?

    Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Creating a WordPress API endpoint’ is closed to new replies.