Gatsby: Get request external website

Created on 4 Apr 2019  路  6Comments  路  Source: gatsbyjs/gatsby

Hi, is possible show information of an external website?

If I need show data on my website (build in gatsby) of an external website how can I make this work?

Any documentation about it?

Thanks

stale? awaiting author response question or discussion

Most helpful comment

@lpluispacheco I don't see why it wouldn't be possible to hit an API, since you can use web technologies on a Gatsby site just like in any React application. A quick search came up with multiple plugins for sourcing content from APIs:

I'm not familiar with Booking's API though鈥揳re you trying to display read-only content or enable the whole booking/purchase flow? The former seems like something you could do on the server-side potentially, but you may be limited to client-side API calls...that is something you'll have to investigate. The plugins listed above may give you some ideas of where to start.

All 6 comments

Hi @lpluispacheco, what kind of information are you hoping to show, and from what website? Is it a domain you own or a random one (the latter will limit what you can do)?

It would help to qualify this request a bit to know what parameters we're working with. Does the website have an API you can call, or are you trying to scrape the content?

Hi @marcysutton, sorry for details left.

It's a API of Booking: https://developers.booking.com/api/commercial/index.html?version=2.4&page_url=how-to-book

Technically i'll putting the dates, persons but I want to show it directly on my website, is it possible? I was trying to find information about it but I couldn't find nothing.

Thanks for your answer!

@lpluispacheco I don't see why it wouldn't be possible to hit an API, since you can use web technologies on a Gatsby site just like in any React application. A quick search came up with multiple plugins for sourcing content from APIs:

I'm not familiar with Booking's API though鈥揳re you trying to display read-only content or enable the whole booking/purchase flow? The former seems like something you could do on the server-side potentially, but you may be limited to client-side API calls...that is something you'll have to investigate. The plugins listed above may give you some ideas of where to start.

Another option that might be viable is to use Axios to pull in the content from Booking.com on the client-side which may be better suited here because the (presumably) real-time nature of the booking information?

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.

Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

totsteps picture totsteps  路  3Comments

brandonmp picture brandonmp  路  3Comments

kalinchernev picture kalinchernev  路  3Comments

magicly picture magicly  路  3Comments

dustinhorton picture dustinhorton  路  3Comments