Google custom search: can't get api key - api

I want to programmatically search the web using Google, and after hours of Google searching I have found this answer, but it was written in 2016 and many things have changed since then.
Following the tutorial, I created a stub custom search engine that indexes the entire internet, you can view my search engine if you want, not sure if you have permission to do so though.
Then I clicked Get started button on the right of Custom Search JSON API, got redirected here:
https://developers.google.com/custom-search/v1/introduction
I clicked that big Get a Key button and this happened:
Couldn't initialize
Service 'customsearch' not found or permission denied.
I searched that message and found exactly nothing relevant.
Then I went to console.cloud.google.com and enabled Custom Search API for the stub project I had to create in order to access youtube-data-api-v3:
https://console.cloud.google.com/apis/api/customsearch.googleapis.com/metrics?project=project-athena-348708
I noticed that its name is customsearch.googleapis.com and not customsearch.
Then I clicked CREATE CRENDENTIALS button and was forced to try to create a stupid nonsensical useless service account just to get an API key, because there is no other way to get an API key...
And it took forever and failed every single time...
What can I try, at this point, to get a customsearch API key?

Turns out the solution is extremely simple, in fact it is so simple it is stupid.
The solution? Don't click that big and obvious CREATE CRENDENTIALS button, because that is clearly what Google wants us users to click, and chances are extremely high that is not what you wanted.
Then how to get an API key to the service?
Well any API key associated with the project is a valid API key for any service enabled in the project, I only figured it out because API key 1 text in "Credentials" box.
But it recommended to use different API keys for different API services because each free API key has a 10,000 daily use quota.
Then how to create an API key?
Well, in the left pane, click Credentials, then click + CREATE CRENDENTIALS, then choose API key, done.

Related

YouTube Api V3: Access not configured

The api key I used was deleted by the Person who gave it to me, no big deal, I can generate my own one.
I created the Project, activated the Access to the YouTube api, created my key and tryed to use it in my Project.
At first I got the message, that the key would be bad or was non existing. After a few minutes, the key seemed to be registered, but now i get a different error message:
domain: 'usageLimits',
reason: 'accessNotConfigured',
message: 'Access Not Configured. YouTube Data API has not been used in project 'my Project id' before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project='my Project id' then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.',
When I open the given URL, i just get the overview, where even is mentioned, that the API is activated:
Aktivierungsstatus
Aktiviert
I tried to delete my key, deactivate the API again, reactivate it, and create a new key. And I added my Domain to the trusted Domains.
Tried different restrictions for the calling and the APIs, and even removed all restrictions.
What could cause the problem?
I more or less (didn't) solve the Problem.
After waiting for some days Overall, and recreating keys, reactivating the api and much more, i gave up today.
Looked through many tutorials and blog Posts and just did a step by step guide on how to use the api for a WordPress YouTube Plugin.
So, i created a new Project (almost identical Name) on the same Google account, activated the api, created the api key, and on the first try, without waiting or anything, it worked.
3 Steps:
- Create a new Project
- Activate the api
- Create the api key
I dont know why this does not work on my first Project, as i did the exact identical steps.

Using Google Developer API keys in distributed applications

I was looking at the Google Fonts Developer API, where you can programatically query the Google Fonts catalog and get some JSON results. You have to get a an API key through Google to use it.
I want to create an extension/plugin for a text editor where you can query the Google Fonts catalog using this API. I would plan on distributing this plugin for anyone to use.
However, in order for it work, I obviously have to sign up for an API key and include that in the code for the plugin so it gets distributed also.
I know that API keys like this as not secret passwords or anything like that, but should they be distributed like this? If one was to build something like this, this seems like the only way to do it.
What happens if someday my own Google account is compromised? What if I need to refresh the API key for some random reason, etc? Then all those users of the plugin would be out of luck since the plugin is using an old key.
What is the best approach to this type of problem? I was planning on having the API key to be "editable" in the plugin so that one could use their own key if they wished, but I don't want that to be a requirement because it just creates a higher barrier to entry.

How to acquire API key for Airbnb

I know that Airbnb haven't opened their API to the public yet, but searching the internet I found some people are using it.
I tried to contact them, and also Airbnb, but without any answers.
Does anyone here knows any contact email, page, or phone number that I can refer to?
I have read here that you can find your API key by looking at the requests that AirBNB uses in their own website. So use the web-developer tools in chrome, or firefox, or firebug in firefox and search trough the requests in the network panel until you find the key being used in any JSON request. Some urls contain this key param, you copy that :) works for me!
Oh BTW, i'd like to remind you that the API is currently not officially released to fetch data in the background while you are logged in. When you use this key, they'll know your identity. You might get blocked or at least warned by AirBNB for using their API while you are maybe not allowed to. Read their terms & conditions to make sure. I am not taking any responsibility, of course ;)
You can now find your API key on the meta tags of the source code when logged in to your dashboard. Search for canonical_host and you will find:
{"canonical_host":"www.airbnb.com","api_config":{"key":"<your-api-key>"}
Just to update this set of answers, the api is on the following address but you need to request access first.
https://www.airbnb.com/partner
It offers an FAQ that informs you about the process and it will always be updated
As far as I can tell, they have shut down this service as of today.
"Unfortunately, this is no longer available" will be what the API returns.
EDIT:
It started working again after a few days. Very odd, maybe an internal problem, or we were rate limited or something.
Log into Airbnb.com, open up the web developer console, go to the network tab, filter by type json, and look at the url and find "client_id".
I found this answer here

What is "Base Path" when composing a new API on BlueMix's API manager?

I am trying to create a new API in Bluemix with the API Manager service. One of the initial things that it wants to know is the "base path" of the API. I decided that must be the public URL of the API (e.g., "http://cpe-personalityexplorer.mybluemix.net/") that is common to all of my API calls, but apparently that is not the case. API Manager doesn't seem to like anything I put there, and I can't find any helpful documentation that explains what it is looking for or why it doesn't like what I entered. I don't get any error messages, just a red box around that input field and a disabled submit button.
Can someone tell me exactly what I should enter in that field?
After some digging, it seems that this field is asking for the root of the API URL, sans protocol, server, and domain. I left the field blank and the API Manager replaced it with "/".
It would be nice if API Manager would give an error message in this situation.

API key invalid or not approved by Google

I'm currently upgrading one of my websites from the old system to HTML5 and I have some problems with the Google Maps JavaScript API v3. To fetch data from their API, you must have an key - of course - but it's here I have the problem.
The problem is that even if I have an correct key that I have added on their Google APIs Console I'm getting "Permission Denied" all the time, followed by an alert window that say that I don't have an real API key or it's not approved to Google Maps JavaScript API v3.
I have turned on "Google Maps API v3" in "Services" on Google APIs Console and payed the "bill" but that didn't help at all as proved. I'm using this URL to their API: http://maps.googleapis.com/maps/api/js?key={MY_KEY}&sensor=false and I have readed their documentions very carefully and I'm currently out of ideas.
Do you know what's wrong here? Have I missed something or what?
In the absence of a link to check...
You can have more than one Project (dropdown, top left in the Console), and each key is tied to a project. Maps v3 must be enabled for the right project.
The seqence should be:
Choose project from the dropdown (or create one)
Choose the services required by that project
Choose collaborators if any
Set up the access keys for that project. You can have more than one key per project and specify the domains the keys can be used on.
Set up billing if you need it.
The menu on the left is set out in a logical order.