Javascript is not related with this.
You need to create 2 processes, one to read the information from your provider's API and another one to insert this data into your PS.
EDIT: But I mean, the information that they give you is not relevant with PS. They could have a TXT, XLS, database, etc. Doesn't matter. You need a process to read this information and then a process to insert in PS, but they are independent.