Add external sources

How can we add external sources in strapi???

Can you please provide more information, what kind of external sources, how do you plan on using them, ect.

Hi DMehaffy,

Thanks for the response.
We are looking to integrate external sources with strapi.
Example:- We will search the data from intergrated external source and aggregate the result to import data in a new collection types.


As I understood you want to retrieve some data from an external source and store it in collection type?

In this case you either need to create a new route/controller to fetch the data and store it, or modify the existing ones and fetch the data to inject into the response.

Hi DMehaffy,

Yes, you are correct.

Hi Sunnyson,

You are correct. How can I achieve this.

Create a service with a function that gets the data and stores it in collection.

module.exports = {
   fetchData: async () => {
         let collectionType = 'candidates';
         let { data } = await axios.get('');
         for (const key in data) {
           let candidate = data[key];
           await strapi.query(collectionType).create(candidate);

You can call it like this:[serviceName].fetchData() in cron or in a controller, depends on your needs.

1 Like

Hi Sunnyson,

Thanks for the response.
I will try the method you have suggested to me. And let you know if it works.

You can also take a loot at that article: Build your own API from any website with Puppeteer

There is described the process of getting data from an external source by using puppeteer, also that depends on your needs, if your external source has API you can replace puppeteer logic with Axios requests, otherwise if you want to get data from HTML code then you should get it with puppeteer.