amadeus api hotels getting offers? - amadeus

i am getting list of hotels with the :
https://test.api.amadeus.com/v1/reference-data/locations/hotels/by-geocode
end point
when trying to get offers from the list of hotels with hotelid
like this:
https://test.api.amadeus.com/v3/shopping/hotel-offers?hotelIds=WVNYC155,NZNYC425,SCNYC047,NZNYC288,XTNYCBSH&adults=1&checkInDate=2023-04-22
it allways return empty array
when trying with the id in the example "MCLONGHM" it works
but not with the ids i get from hotels search

This is because you use the test environment that contains limited data comparing to the production one.
If you want to know more about the data collection in test check here.

Related

Is there an API call to list all available product id's (ID's alone) in Shopify?

I use POSTMAN GUI for retrieving a list of items from Shopify API.
I would like to know if there exists a way to get available product id's alone, preferably as a list of values over a single api GET call. The one I know of is
/admin/api/2022-04/products.json
It returns a list of all product information, and looping over them/traversing the json is not very efficient. I hope there must be an easy way to fetch all ID's alone in one go. Should there be not?
You can add /admin/api/2022-04/products.json?fields=id to the end of your request to limit the output only for a single field or multiply.
Please note that if you have more than 250 products you will need to make more than one request, since the request is limited to 250 products.
You can make one call to the Admin API for all your product IDs using the Bulk Query. That will result in you receiving a URL where you download a file in JSONL format with every single product ID in your store, without the paging or limits of other approaches.

How to access weather data from all the stations in one country using openweathermap?

I am using Alteryx to extract weather data for a handful of cities and it works great. I'd like to expand this to able to download data for all weather stations in the UK. At the moment I am specifying which cities I want, e.g. London / Manchester.
Is there a way of specifying in the api call to download all stations in 'GB' or 'UK'?
Ideally I'd like to do this in one call rather than listing all locations which will be very laborious
Get a list of stations or cities that you want to retrieve weather data from. I found some good sources from openweather here: http://bulk.openweathermap.org/sample/
Then build a url request using the list of id's above that retrieves specific weather information. Using an id for the weather station in Cairns, id=2172797, the url ends up looking like:
http://api.openweathermap.org/data/2.5/weather?id=2172797&appid=843798874aac0ef138e6f77c72f3af80
Note that this url will return an error because this isn't a real appid. If you replace the appid with your own, this url will give you data for that station.
Putting this process into Alteryx lets you put the list of station id's together with the url and the appid to make many calls into openweather and then process all of the data together. I could not find information from the API on rate limits, so be conscious of how many requests you are posting to the service.
There is an example of this process here: https://www.dropbox.com/s/yoppbx3bw0p4rug/Get%20individual%20stations.yxzp?dl=0
Keep in mind that you have to update the Appid in the text input tool within this sample as well.

Link LSOA codes with ordnance survey postcodes and endpoint

I am new to linked data and trying to link ordnance survey postcodes to LSOA data.
I am using the OS linked Data Sparql API and the end point is:
http://data.ordnancesurvey.co.uk/datasets/os-linked-data/apis/sparql
I have a query which returns the postcodes, although I am trying to link LSOA codes with the postcodes to learn from. The code I have so far is:
SELECT ?postcode WHERE {
?postcodeUnit a <http://data.ordnancesurvey.co.uk/ontology/postcode/PostcodeUnit>
BIND (STRAFTER((STR(?postcodeUnit)),'postcodeunit/') as ?postcode)
}limit 10
This code brings back the postcodes, but I am trying to link to LSOA codes.
Thanks in Advance
You may be a bit stuck with this data source.
http://data.ordnancesurvey.co.uk/ontology/postcode/PostcodeUnit
Shows that there is no LSOA data associated with a postcode unit. And a quick look at the RDF for the site shows that they don't have a field called LSOA.

Album search API return different results

I've got a different result when requesting the Deezer search API for an album from my production server:
for instance this search: http://api.deezer.com/search/album?q=Billy%20Ze%20kick%20et%20Les%20Gamins%20en%20Folie%20Billy%20Ze%20Kick%20et%20Les%20Gamins%20en%20Folie
-on my laptop in France, I've got 2 results and the album #215350 as first result
-on an heroku europe instance I've got 2 results, and the album #41910 as first result (absolutely no result if the heroku instance is in the US...)
-and on my production (digital ocean in Amsterdam) server I've got the album #41910 as one and only result.
I'm assuming there is a legal issue related on which country this album is available but is there any way to avoid this?
others similars APIs have a local attribute which allow me to see if the album is available in the country of my end user...
this is a real issue my server is in Amsterdam... my users are everywhere...
Any idea or solution?
Thanks!
Search results are localized based on the current user's country (IP based). You can override the country by passing a user token to the request to make sure you always get the same results.
About availability, it is track-based: if you want to know if the song is available in a country, you'll have to query each track from your album. For example, http://api.deezer.com/track/2150054 returns the list of available countries.

How to get item in REST API by multiple item id

I have product_id and onec_id columns to get items from DB. Which API routes should I use to get items by product_id or by onec_id?
Is it right for REST routes?
GET /products/{product_id}
GET /products/get_by_onec_id/{onec_id}
The most REST solution is to fire one HTTP request for each id. For example
GET /product/736
REST is intended to represent the state of a resource. It can return a set of items, but only if these items relate to each other in some way. For example
GET /onec/492/products
Will return the set of products associated with the specified onec.
If you want to return the set of products identified by a set of IDs in a single request, you may have your shortcut syntax like
GET /products/12,768,56,086
But it's not really common because it's quite a departure from the REST objectives
To get a single Product or Onec(?), GET
/products/{id}
/onecs/{id}