A
A
Anton2021-11-28 13:08:57
API
Anton, 2021-11-28 13:08:57

Data from third party API - how to display on WP site?

Good afternoon.
Please tell me:
I am creating a new site on WP, I need to pull data from a third-party site using their API to the page of my site on WP.
Can it be done?

Let's deal with this foreign API, there is detailed documentation. I don’t understand exactly how to display the data received via api on my WP site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2021-11-28
@agvrson

The question is very general, but in general - yes, this can be done. Depends on what kind of data you want to output.
If the weather, for example, then once in a while I would receive data with a separate script not related to WP and save it somewhere "locally", and then take it from this storage and display it on the site when generating the page. There are different ways - you can write a plugin for WP, you can add your own shortcode in the theme files and use it, you can simply access your storage and display data in the template.
If you are receiving data from the user, passing it to the API and then displaying it (some API for calculating shipping costs, for example), then the storage option is unlikely to suit you (well, except for short-term caching).
In general, more data is needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question