Installing an External API Into Perch

  • Hi everyone


    I’m looking to connect an external API to a standard Perch site but I have never done it before so I was wondering if anyone had and pointers or tips.


    I am wanting to display the local tide times and there is an API available that provides the data for which I’m guessing I can then somehow manipulate and style?


    Many thanks for any help :thumbup:


    Glen

  • Glen

    Changed the title of the thread from “Installing an External API With Perch” to “Installing an External API Into Perch”.
  • Hi hus_hmd


    So sorry for the delay, I've only just spotted your reply.


    I think periodically would be ok, my idea is to have a tide times page that shows the low tide times and high tide times for the next 7 days (data brought in via the API), but then on another page, use that data to show the next low tide and next high tide.


    Many thanks


    Glen

  • You can build a Perch app and register a scheduled task so it periodically fetches the data you need.


    Depending on your requirements you may choose to store the data in the database or even just save it in a parse-able format like JSON in a file. I'd consider the amount of data, how long you need to keep the data and whether you need to paginate and filter it.