How to use {loc_physical_ms} to get city and ZIP code on your website? - api

So I have a client that wants to do a Google Ad campaign for certain locations. From what we gathered, you can set up location of interest and pass on a parameter {loc_physical_ms} that can be used to get some details based on that ID. My question is, how do I access that info? Is it by using an API? I did looked at the reference here:
https://developers.google.com/adwords/api/docs/appendix/geotargeting
But it is not explained how I can use that ID on my website to get something like the ZIP code and city of the click. I been looking around, but to no avail. Any suggestion is welcome.
Thanks in advance!

Ok, found the solution. So for anyone that may come across this, that link I have above provides you with a CSV with the latest Geo Target list. I was under the impression that Google would provide an API for us to use, but that is not the case here. You will have to import that data into your database, and then use it from there. So once you have that data in your database, you can then just make a query that will use the ID from the parameter {loc_physical_ms} from the database as reference for your query.

Related

How to supply data for search bar suggestions

Basically I'm working on my personal project, and I'm building a react native app that serves a very similar purpose to that of eBay's or Gumtree or the like. Users can obviously search for a product, I want to show search suggestions based on what the user types. Search engines usually show suggestions based on what is also being searched by other users, or what data is already is already posted on the site.
Since this is a personal project neither of those two cases apply. I need a way to still provide suggestions to user searches.
One way I tried doing this, is by finding a txt file with a bunch of product names and filtering through that based on user search.
I tried doing the same approach but by using an API instead of a text file.
I couldn't find any resources for either of those 2 methods, so I don't really know what to do
Any suggestions or references to material would be greatly appreciated!

OpenAlex API - How to get institution ID?

I am trying to use the OpenAlex API: https://docs.openalex.org/api
This API provides access to a catalog of scholarly papers, authors, institutions, etc...
It is easy enough to make a query for an institution's information such. Here is an example from the API docs:
https://api.openalex.org/I19820366
I am trying to figure out how to get a specific institution's ID.
In the docs, there is a statement that this ID number is Microsoft Academic Graph's institutional ID: https://www.microsoft.com/en-us/research/project/microsoft-academic-graph/
But I have been unable to figure out anything in Microsoft Academic Graph either.
How can I find the institutional ID for a specific institution?
I am a beginner, and I also just started to retrieve data from the OpenAlex API. For me, the easiest way was either to use the ROR id or the GRID id, which you can both look up for any institution either here: https://www.grid.ac/ or here: https://ror.org/
Then you use either ROR or GRID-ID as an identifier (https://docs.openalex.org/about-the-data/institution#ids) and that identifier as a filter, as specified in the API documentation.
Be aware, that except for the Institution-ID, that you want to find, all the other institutional IDs, like ROR or GRID, have to be put in your request as a full URL. Take the example of the Johns Hopkins University. It's not enough to put their ROR like this: "00za53h95", you have to put in the API request like that: "https://ror.org/00za53h95" (without the quotes) or else it won't work. In my example, a request could look like this:
https://api.openalex.org/institutions/https://ror.org/00za53h95
This will deliver a nice json file with all the info you need, including the institution's ID in the database. Save the information as a file by using a cURL GET request or just do it via your browser and get the result as a webpage, both works. If you do the latter, you should follow the suggestion of the OpenAlex team and install a browser plugin like JSONVue, that will make the experience of reading the result on your screen so much better.
Hope that helps.
You can use the OpenAlex API to search for the ID like this:
https://api.openalex.org/institutions?filter=display_name.search:University%20of%20Virginia
In addition to Heather's comment, I'd like to add that we can now go to https://explore.openalex.org/ and search for any entity. Start typing "Johns Hopkins University" and you'll get to this page: https://explore.openalex.org/institutions/I145311948 which has all the identifiers (including the openalex id I145311948) and additional information about this institution.

How to get reposted tracks from my activities?

Using the Souncloud API, I'd like to retrieve the reposted tracks from my activities. The /me/activities endpoint seems suited for this and I tried the different types provided.
However, I didn't find out how to get that data. Does anyone know?
Replace User Id, limit and offset with what you need:
https://api-v2.soundcloud.com/profile/soundcloud:users:41691970?limit=50&offset=0
You could try the following approach:
Get the users that shared a track via /tracks/{id}/shared-to/users endpoint.
Fetch the tracks postet by this user via /tracks endpoint, as the _user_id_ is contained.
Compare the tracks metadata with the one you originally posted.
I am not into the Soundcloud API, but taking a close look at it seems to make this approach at least as technical possible, though e.g. fetching all tracks won't be a production solution, of course. It's more a hint. Perhaps reposting means something totally different in this context.
And the specified entpoint exists in the general api doc, so I don't know if you would have to extend the java-api-wrapper for using it.

get +1 date timestamp or for google plus activities/posts

I am trying to get some information about the post people do in google plus. In particular I am interested in the "+1"'s.
Either from the google api or directly from the google plus web site you can get the total count and name of the people who did "+1". But, I would be interested in getting the time or timestamp of the "+1"'s. Does anyone knows if it is possible or how can I do that?
Help is always appreciated
Thanks to all,
As you can see at https://developers.google.com/+/api/latest/activities, the only data we return for a +1 is a list of the +1-ers, as well as the total number of people who +1'ed the item you are looking at.
If you would like to request additional data, please file a feature request in our Issue Tracker: https://code.google.com/p/google-plus-platform/issues/list. It would really help if you could be as detailed as possible in the type of data you would like to see and how you would ideally use that data.
If you're dealing with your own website and only care about +1s for pages on your own domain, you could use Google Analytic's social information to see how +1s change over time. You wouldn't get information about who did the +1ing.

How to fetch, display Amazon Marketplace listings by item?

My question pretty much says it all: I'm looking for a way to display Amazon Marketplace listings based on an item lookup. Example: If I do a call to ItemLookup with an ASIN of 0590353403 (Harry Potter and the Sorcerer's Stone), I'm looking for a result set of perhaps the top ten new or used Marketplace listings, preferably with seller information attached.
I apologize if this is clearly documented somewhere, but I have been looking all through the Amazon API docs and on Google to no avail. StackOverflow doesn't seem to have any Related Questions that match what I'm asking, either.
Thanks in advance!
After some further research, it seems I've found what I was looking for. In order to get a listing of all sale offers -- not just those from Amazon itself -- you must specify the MerchantId parameter in your query to the web service. This parameter can take on a few different values: "Amazon" (default), "All," "Featured," or a specific Merchant ID.
To get all the offer information, including seller names and the like, you must also submit the parameter ResponseGroup with the value "OfferFull."
Hope this helps somebody else out down the line! :-)