How to obtain the traffic signs belonging to a set of LINK_IDS - rest

I am using the REST API of HERE. I am trying to obtain the traffic signs corresponding to a set of LINK_IDS.
I have a list of the links (unique IDs) I am interested in, however I do not know how to obtain the traffic signs which are found in these links. As I understand there should only be 1 traffic sign in each link, at the end of the link.
Can anyone hint what is the way to proceed? I was trying to use Platform Data Extension API to do this, but have not been successful.
The most I have been able to achieve is obtaining all the traffic signs in one tile, by querying the following:
http://pde.cit.api.here.com/1/tile.json?region=EU
&release=LATEST
&layer=TRAFFIC_SIGN_FC1
&level=9
&tilex=537&tiley=399
&app_id={APP_ID}&app_code={APP_CODE}
However, this is not even working for all locations. I tried in different parts of the city of London and the output I obtain is:
{
"Rows":
Array[0][
]
}
In summary, my goal is to obtain the corresponding traffic sign (s) in a link. That is, for link with ID XXXXXXXXX I would like to see which is the traffic sign present in the location marked by this link.

I am trying to obtain the traffic signs corresponding to a set of LINK_IDS
There is no straight solution to this yet. You have to use PDE layer which gets all traffic information for a tile and then extract the link ids of your interest. We have 100% coverage in WEU and NA. For MEA, we have 100% coverage on FC1-FC4 roads and less coverage on FC5 roads(which are destination roads).

Related

Filtering certain coins based upon name with CoinMarketCap

I'm currently attempting to use the CoinMarketCap API but finding it frustrating.
I'm wanting to use this URL to query their API:
https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest
However, rather than finding all, or just simply filtering based upon the number, I want to find a certain few coins.
So for example, I want to only find Bitcoin, Ethereum and Cardano.
Looking at their docs, it suggests you can sort by name, but it appears this is only listing them alphabetically, which I don't want to do.
So can anyone suggest how to query their API successfully and find just Bitcoin, Ethereum and Cardano using that GET URL above?
Here's the URL to the specific URL for the API request: https://coinmarketcap.com/api/documentation/v1/#operation/getV1CryptocurrencyListingsLatest
For this purpose, you can use the endpoint Quotes Latest:
https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest
It allows you to pass a list of identifiers in a string as a parameter, like this:
1,1027,328
or a list of slugs:
bitcoin,ethereum,monero
or a list of symbols
BTC,ETH,XMR
If you trying to scrape information about new listings at crypto exchanges, you can be interested in this API:
https://rapidapi.com/Diver44/api/new-cryptocurrencies-listings/
It includes an endpoint with New Listings, New Pairs from the biggest exchanges and a very useful endpoint with information about exchanges where you can buy specific coins and prices for this coin at that exchange. It's a bit paid, but it's worth it!

MKRoute Not Identifying Ferry Routes

Within MKDirections I am looking for a route that does not comprise any step with a ferry in it. Using the MKDirectionsTransportType at this stage isn't helpful as the ferry can be a single step in an overall route that would not be identified at an overall route level. As a result I am looking at the transport type for each step MKRoute.Step. However, it does not look like Apple is properly reporting a step that is clearly a ferry as a transport type that is not an automobile. Printing out instructions for each step I get the following for a given step: "Take the “Washington State Ferry” ferry" Clearly this step is using something other than an automobile and from the list of transport type options I would have assumed transit but again it's actually returning automobile.
Has anyone dealt with this prior and is there another reliable way to be able to detect and eliminate something like a ferry? I am hesitant to use the string and simply search for "ferry" as that could be inconsistent and might be the name of a legitimate road, etc. Not clear why Apple is not identifying a ferry properly which is also happening with other ferries - the Long Island Ferry - as an example.

Generating a secure key that restricts a user to a particular radius

I was thinking of using Algolia's Secured API Keys feature to limit my users' queries to a particular geographic area (e.g., 50 miles around their home location). The idea was that users shouldn't be able to search the entire system, only the part of it that is relevant to them, thus limiting overall exposure of database. Does the API support anything like this, or do I need to use the tagging feature to do something less specific, e.g., tagging records by the user's home state ("New York") and then restricting access based on that tag?
you should be able to do so by generating a specific API key with pre-filled search parameters for each of your user.
Each key will have a specific around lat lng parameter and a specific radius also.
The user will not be able to trick the key to use different pre-filled search parameters. But you can still use different parameters (that were not pre-filled).
First, you need to create a new search only api key in your dashboard.
Then, using the JavaScript (node.js) client for instance:
var public_key = client.generateSecuredApiKey('YourSearchOnlyApiKey', {aroundLatLng: '43.0909,23.99898', aroundRadius: 50 * 1000});
Then on the frontend, in the browser, using this new api key, your user will only be able to search for items around the provided latitude longitude with a 50km radius.
You can use any geo search parameter https://www.algolia.com/doc/rest#geo-search-parameters.
More infos:
https://www.algolia.com/doc/tutorials/security
https://github.com/algolia/algoliasearch-client-js#security--user-api-keys
Every other API client has the same paragraph.

Fetching Zipcodes falling in between the routes Final and End destination using MapQuest API

I need to fetch zipcodes falling all along the route using MapQuest API.Plz suggest i tried to find on mapquest forum as well as on stack .I also did google but can't manage to find appropriate solution.
Ex : Suppose i define a Route from point A to Point B. Now i need to fetch all zipcodes falling in between this route.
You'll want to look at the Corridor Search, which is part of the Search API Web Service. You have two options; you can either pass in the shapePoints that make up the route (corridor) that you want to search along, or you can use the Directions API to calculate a route and then use the sessionId from the Directions API response as input into the Search request.
Here's an example using the Directions API in conjunction with the Search API:
Use the Directions API to calculate a route between two points. In this example, I'm calculating a route between Denver, CO and Aurora, CO:
http://www.mapquestapi.com/directions/v2/route?key=YOUR-APP-KEY-GOES-HERE&from=Denver,CO&to=Aurora,CO
Locate the sessionId parameter in the response.
Use the Search API to perform a corridor search on the uspostalcodes table. I'm also filtering the results from the table to include just the name of the postal code and none of the other info that is available in the table.
http://www.mapquestapi.com/search/v2/corridor?key=YOUR-APP-KEY-GOES-HERE&sessionId=YOUR-SESSION-ID-GOES-HERE&width=1&buffer=0&hostedData=mqap.uspostalcodes|||POSTCODE
You can adjust the width/buffer options as well to refine your search.
Hope this helps!

What is a good strategy for adding additional information in a GET query over REST?

Given that we provide a restful api that serves book entities listening at
/books
And a client can get a book at the usual
GET /books/{id}
Suppose that we want to begin offering discounts on books to only our most vigilant buyers. These buyers would be given a discount code, and that code will reduce the price of the book.
Thus, a generic response may be
GET /books/4
{"id":4, "price":"24.95"}
Where a response to a query with a discount code may be
GET /books/4
{"id":4, "price":"24.95", "yourPrice":"19.95"}
The back-end processing we can get figured out, but what is the best practice for a client submitting a discount code over a restful api?
Certain books will be eligible for discounts while others will not. Discounts will not be broad (20% off everything), but instead will map to a specific price for that particular code (or client/code combo).
We've considered:
kludging the url
GET /codes/{someCode}/books/{id}
Adding the code in a header value
Using a query string
GET /books?code=myCode
anything else?
EDIT: Our goal is not to implement single-use codes. Instead, these discount codes could be used some fixed number of times for some fixed set of books.
I like using query variables. I just looked at the RESTful Web Services book, my main reference in this area, and they say:
Use query variables only to suggest
arguments being plugged into an
algorithm... If two URIs differ only
in their query variables, it implies
they're the different sets of inputs
into the same underlying algorithm.
It seems to me your discount codes are inputs to a discounting algorithm.
Charles
If you're going to be submitting anything that's not idempotent, I would suggest using POST instead of GET. You wouldn't want a client to be able to use their code more than once.
Anything you add in the URL or header values are open to be intercepted, and possibly allowing other users to 'fake' their discount ID. 1 approach would be to introduce a new POST call, that will allow the ID to be encrypted with simple HTTPS. The POSTed data could be as simple as the discountID or customerID.
Added - Sorry Michael, you already said that :)
You can register the code in a table so when the user retrieves that book automatically returns that book with the proper discount, for example:
The user can add some code
POST /register/{code}
This will add an entry to a table {user} - {code} so when the user retrieves by
GET /books/{id}
will use that entry to apply the discount. I'm guessing that you already have some relation between {code}-{book} so wont get into that.