How to programmatically manage taxonomies?
A simple way to set this up would be a cron hook.

function hook_cron


  Perform periodic actions.
  
  Modules that require some commands to be executed periodically can
  implement hook_cron(). The engine will then call the hook whenever a
  cron run happens, as defined by the administrator. Typical tasks
  managed by hook_cron() are database maintenance, backups,
  recalculation of settings or parameters, automated mailing, and
  retrieving remote data.
  
  Short-running or non-resource-intensive tasks can be executed directly
  in the hook_cron() implementation.
  
  Long-running tasks and tasks that could time out, such as retrieving
  remote data, sending email, and intensive file tasks, should use the
  queue API instead of executing the tasks directly. To do this, first
  define one or more queues via a \Drupal\Core\Annotation\QueueWorker
  plugin. Then, add items that need to be processed to the defined
  queues.


As mentioned a better way for D8 would be to use the queue API.

Or try the dev version of Feeds, which can do this without code:

https://www.drupal.org/project/feeds