机票比较Web应用程序如何获取多家航空公司的机票价格?

发布于 2024-10-09 05:50:33 字数 257 浏览 0 评论 0原文

如上所述,只是出于病态的好奇心。各个航空公司的网站是否有供这些引擎利用的 API?或者您是否编写程序来导航各个网站并提供输入(出发地、目的地、出发日期、返回日期)并获取输出(价格、时间等)?

编辑:好吧,在我提交问题后才发现这个。尽管如此,还是有兴趣看看它是如何以编程方式完成的。在 Java 中,什么样的库适合这个?

As above, just out of morbid curiosity. Do the websites of individual airlines have APIs for these engines to exploit? Or do you write programs to navigate individual websites and provide inputs (origin, destination, dates of departure, return) and obtain the outputs (price, time etc.)?

Edit: Ok just found this after I submitted question. Still, would be interested in looking at how its done programatically. Say in Java, what kind of libraries would be good for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你在我安 2024-10-16 05:50:33

有多种方法可以获取此类信息。
最好的(也是最可靠的)是联系您要与之打交道的航空公司。
许多(如果不是大多数)都会有公共 API 来访问其预订系统,允许用户请求航班报价、座位可用性并进行预订。
当然,通常这需要您和航空公司之间签订合同,告诉您如何使用这些信息,并且对于预订,您可能需要与他们签订另一份合同来处理付款、回扣等。

此类 API 可以是“现代的” “ SOAP 系统,或者更老式的东西,比如 EDI、EJB 调用,或者其他什么,但原则仍然存在:你请求某些东西,他们的服务器会提供请求的信息。

道德上不太正确,更难实施,而且更脆弱,你可以尝试抓取他们的预订引擎。
但它们的屏幕布局当然会定期变化:)

There are several ways to get such information.
The best (and most reliable) would be to contact the airlines you're going to be dealing with.
Many if not most will have public APIs for accessing their reservation system, allowing users to request quotes for flights, seat availability, and make reservations.
Of course usually that will require a contract between you and the airline telling you how you can use the information, and for bookings you're going to probably need another contract with them to handle payments, kickbacks, etc.

Such APIs can be "modern" SOAP systems, or more old fashioned things like EDI, EJB calls, or whatever but the principle remains: you ask for something, their servers give the requested information.

Less ethically correct, harder to implement, and far more fragile you could try screenscraping their reservation engines.
But the screen layout of those of course change regularly :)

我不在是我 2024-10-16 05:50:33

与几家“现代”航空公司合作(几乎是矛盾的),聚合器必须轮询票价搜索页面和“屏幕抓取”,当航空公司更新结构页面时,他们必须非常快地更改解析器。

having worked with a couple of 'modern' airlines (almost an oxymoron) the aggregators have to poll the fare search page and 'screen scrape' and when the airline updates the structure page they have to be mighty quick to change there parser.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文