This article explains how to programmatically retrieve information from the KAKEN (Grants-in-Aid for Scientific Research) database.

1. Introduction

KAKEN is a database for Grants-in-Aid for Scientific Research provided by the National Institute of Informatics (NII). By using the OpenSearch API, you can programmatically retrieve information about research projects.

2. Preparation: Obtaining an Application ID

To use the KAKEN API, you need to obtain an Application ID from CiNii.

  1. Access the CiNii API Registration page
  2. Fill in the required information and submit your registration request
  3. After approval, you will receive an Application ID (appid) by email

Note: It may take some time from registration to approval.

3. API Endpoints

Search for Research Projects

https://kaken.nii.ac.jp/opensearch/

Search for Researchers

https://nrid.nii.ac.jp/opensearch/

4. Main Parameters (Search for Research Projects)

ParameterDescriptionRequiredExample
appidApplication IDYes82RKpPlZiIjbqKwFDO3D
qbSearch by project number*19K20626
kwFree keyword search*IIIF
qaSearch by project title*デジタルアーカイブ
qgSearch by researcher name*中村覚
qmSearch by researcher number*80802743
formatResponse format-xml (default: html5)
rwNumber of items per page-20, 50, 100, 200, 500
langLanguage-ja, en

*: At least one of these is required

Other Search Parameters

ParameterDescription
qcSearch by research category
qdSearch by review section/research field
qeSearch by research institution
s1, s2Search by grant period (From/To)
qfSearch by keyword

For details, please refer to the official documentation.

5. Usage Examples

Example 1: Search by Project Number

curl"https://kaken.nii.ac.jp/opensearch/?appid=YOUR_APPID&qb=19K20626&format=xml"

Example 2: Search by Keyword

curl"https://kaken.nii.ac.jp/opensearch/?appid=YOUR_APPID&kw=IIIF&format=xml&rw=50"

Example 3: Search by Researcher Number

curl"https://kaken.nii.ac.jp/opensearch/?appid=YOUR_APPID&qm=80802743&format=xml"

6. Response Format

When format=xml is specified, an XML response like the following is returned.

Response Example (19K20626)

<<?g/xr<<<<gmatsig/rlnottr<<gattaeau/s/rnvAarmnr<uu<<<<<<<satewltstlurmtacm/pk/p/unAraRIPALrlmiwae<<<<<mre<<<<<<<<ke<<pv<<<mtwsrenewilLatatmidjp/e/eoykkkkkkkkerseeeditvmAaidsdras>irlrebneoe<<<pn<emjweeeeeeeeyitnrrinoeawrosuePrthsyedgespbrffgerrnbeoyyyyyyyywoadiardtrradn>lxad>tt>NortaTsuairierecrwwwwwwwwodrDoleiaayrs=t>gt>xIuririolmvscsirtdoooooooorOtadlcrll>d>"s1eirpapmImystttnlieohec>SLrrrrrrrrdfDtOAteCl>1><>derwslIbeumlaNlnneahtiddddddddLAaefwCcoA.1/2=coa::FenqteelayNadreasiwt>Aaotsw0<s0"ojr/lriuin>NmNal>cdttsssssssssae2wrsCta"/t<Kred/aTieotaeamNh>u>eeeeeeeetr>0adto>rta/AdcNknEaCnn>m>meaesqqqqqqqq>d22rA>s4deoriKStuagIwoc><eemruuuuuuuu>03dm3t5AntttEeTmk=ade/yeNfeeeeeeee1->o5>5mcaIeNtybe"re=jsyo>uinnnnnnnn90u010oolnmH=penjd="oeommscccccccc-3n000udRdsI"er.aN"1bq<mibceeeeeeee0-t050nieeP-k==n"u2"<<Tu/i=ea========43>000tnsxePa""i>m5//ief="rl""""""""-100<>gu>rRkp1ib2eidtnu"Y123456780<<0/=lPOer9.e"rnelclte""""""""1//0t"taJnoKar>aspeelya>>>>>>>><ed<UsgEhj2c=dta>=N"prITROO/nitT>eCie0."Cir"a>e=IEDCmsdriaF>T"c6j1ott1m"="IIFRe<tDenl--t2p9dum"e><"2F<<<k/aacdC81"6/K<ete>>/e0<//akrttio"9"g2/=ingr2kkk<<eteCrs?K>r0c"ot<ia2keee//yD>oet>2a6a8n>/vd"eyyykkwasc>0n2t0>fe"ywwweeottt6t6e8an>swoooyy<re>C2/"g0mN8torrrwwd>o6K<o2ia0ardddok>s"A/sr7lm8td>>>rretKtey4ye0u>ddy>Eiq>3N>2s>>wNtu"a7CoHlem4orIenre3dd->co><e>Pel/=R=er"O"=epJ1"srE"peoC/rajT>ire-ncc1cht9ie_Kprc2aNl0luo6_ms2ibe6ned/vr"<e>//s>utrilg>ator">

7. Main Information Available

ElementDescription
awardNumberProject number
titleResearch project title
categoryResearch category (Early-Career Research, Grant-in-Aid for Scientific Research, etc.)
memberResearcher information (name, affiliation, researcher number, role)
projectStatusProject status (granted: ongoing, project_closed: completed)
keywordListKeywords
periodOfAwardResearch period
overallAwardAmountBudget allocation (direct costs, indirect costs, total)
paragraphListResearch summary

Researcher Roles (role attribute)

ValueDescription
principal_investigatorPrincipal Investigator
co_investigator_buntanCo-Investigator (sharing responsibilities)
co_investigator_renkeiCo-Investigator (collaboration)

8. Programmatic Usage Examples

JavaScript/TypeScript (Next.js)

t}t}a)}f}y;y;s:upnrridjpgtcpmkygacuuucicrneaeoneoeriaeeenrpPorrrofoecmslspbattrmycaprnlllnnttKeeetaTKnleibwnIos...s(suiXa:a:iriategoeoftdmtssst!troMkrtttkI:odrruI:ieeernnLesc'umledr?sdndsuaaarexnthpteen:sy::sc:serrrresmpppMreiin?Pt??tt<lcccsplaaaeir'ot:rsr:{K:isrKhhhporrrmnIn:otiaotia=PPPon=sssbgd:sjrnssksnrnkaaanseeie;:steigttetigenrrrseaKKnr'strcn;ranrfnneaaae.waagsctritgirMiegPwmmmoakk=torin;ntent,rsss=kieelriing=g?mgcoU...)tnno{i'ng;;:b[hjRsssaXXgn;g;{e]KeLeeewrrmmig;sr;ac(tttaeellc;t[kt'(((its((r]eh'''tupxxi;n|taqfrommnPtpbofnnllgrnpp'res,:;ousi,mtnejl:dacu.gseel/'gthltrtnc>,r'(leardtka,u;xni?({aanrttn:kpt'l(IgepIx.)d,snIdmt;)t.d)lo;grn);'Srii;)tani;rng.itanI}cgd;.(:j)p)s/;torpienngs)e:arKcahk/e'n)P;roject|null{

Python

iid#pmmerppfUooosjrrfup}rir##aetteraefogctlrsoXetrxcaprtMemh=m"""oerLe=ql_saqfnse=xu.k"pbosptpafeeah=p"reouEamestkti:mnrTrpttret{da=sn.slcsenp"gtefiehe_s:r"r.Nrn_.p:a:esoogkEranqtnmal/pt"uaeslkejkp_xettoemea_imsurgneckidltsii_nted,"s_ncpt(n,.cgrTg.go(orrnedrjeaiteeeeni(sct.u!pta_ar=o(sicln"d.,2s1E:j0e9Tpp0.Ks/a:c2toro0rpan6,emt2nse6as=n"pept,paa)_rr"icaYdhmO:/sU")Rs_tArP)PID")dict|None:

9. Notes

  1. Comply with Terms of Use: Avoid making a large number of requests in a short period of time
  2. Use Caching: If you need to retrieve the same data repeatedly, use caching
  3. About Affiliation Information: The affiliation available through the API is from the time the grant was awarded. It may differ from the current affiliation
  4. Error Handling: Implement fallback processing for cases when the API is unavailable