Friday, 3 August 2018

SEO: how to index data from a client-side api requests

I am not looking for a specific tutorial on how to set this up. I am actually wanting to know what is possible and what is not.

In my Angular 6 application I am learning how to load content serverside so bots can index the client data. There is a lot of data that comes from api requests that I would like to be crawled also. For example the following code gets the current pages project data from my ecommerce's API.

In my Angular Component

getProductById(product_id) {
    const data = { product_id: product_id };
    return this.http.get<any>( api_url + '/getProductById', {params: data} );
}

this is a call to my api which returns data from BigCommerce (see below)

my Express API

getProductById = (req, res, next) => {
    let product_id = req.query.product_id;
    return bc_v3.get(`/catalog/products/${product_id}`).then(data => {
        return data; // this data will then return back to the client async
    });
};

is it possible to index data coming from an API?

Can the data returned from the API be indexed by SEO bots?



from SEO: how to index data from a client-side api requests

No comments:

Post a Comment