Reputation: 21985
How can I get a generic cx
ID for using the custom search API in Python?
http://code.google.com/p/google-api-python-client/source/browse/samples/customsearch/main.py
From what I have read I understand that this cx
ID is for certain sites only(when creating a custom search engine it asks me for specific sites), but I want it to search on google, so I can get the first 3-5 results from a google-search.
So I want to search on GOOGLE using Custom Search API, I already got a Developer Key, I just need to find how can I get an cx
ID for searching on google, not a personal site, or something like that.
Upvotes: 36
Views: 60133
Reputation: 362
As of 2023
Upvotes: 1
Reputation: 2358
As of 2020
2012 Answer outdated.
here you can find the cx id http://www.google.com/cse/manage/all
. look for My search engines then choose from the list
Upvotes: 50
Reputation: 21985
Solved: Go to your
Custom Search Engine ->
Edit Search Engine ->
Basics ->
Sites to Search ->
select: Search the entire web
but emphasize included sites.
Upvotes: 22
Reputation:
As of 2017 (this may be outdated in the future), here are the steps:
1) After getting the API key (under Custom Search API) here
2) Head to CSE home
3) Click on Add below Edit Search Engine
4) You'll get a search box, type in www.google.com and then click on Create at the bottom
5) You'll get your cx code (called Search Engine ID) to use with your API key
Upvotes: 24
Reputation: 17
On the Custom Search wizard,it's true that you will be asked to choose some sites, but you are allowed to use wild cards, so you can type *.edu, *.org, ... so your search can be very large!
I quote what the wizard tells me on URL's formatting (sorry , in french!):
"Formatage des URL
Pages individuelles : si vous indiquez www.mysite.com/mypage.html, seule la page mypage.html est incluse sur www.mysite.com.
Sites entiers : si vous indiquez www.mysite.com/*, toutes les pages de www.mysite.com sont incluses.
Parties de sites : vous pouvez utiliser des caractères génériques pour inclure uniquement certaines parties d'un site. Par exemple, www.mysite.com/*about* permet d'inclure uniquement les fichiers sur www.mysite.com contenant about dans leur nom.
Domaines entiers : vous pouvez également spécifier un domaine entier en utilisant *.mydomain.com. Si vous indiquez mydomain.com, le système le convertit automatiquement en *.mydomain.com/*. Si ce n'est pas ce que vous voulez, vous pouvez revenir en arrière dans le panneau de configuration.
Upvotes: 0