<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>楽天商品検索API &#8211; ケケンタの独学ITブログ</title>
	<atom:link href="https://kekenta-it-blog.com/tag/%E6%A5%BD%E5%A4%A9%E5%95%86%E5%93%81%E6%A4%9C%E7%B4%A2api/feed/" rel="self" type="application/rss+xml" />
	<link>https://kekenta-it-blog.com</link>
	<description>プログラミングやWeb制作の情報を発信</description>
	<lastBuildDate>Tue, 18 Mar 2025 01:54:57 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://kekenta-it-blog.com/wp-content/uploads/2023/07/cropped-KEKENTA-BLOG-32x32.png</url>
	<title>楽天商品検索API &#8211; ケケンタの独学ITブログ</title>
	<link>https://kekenta-it-blog.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>【PHP】APIとは？楽天APIで商品検索機能を作成する方法</title>
		<link>https://kekenta-it-blog.com/php-rakuten-api/</link>
					<comments>https://kekenta-it-blog.com/php-rakuten-api/#respond</comments>
		
		<dc:creator><![CDATA[ケケンタ]]></dc:creator>
		<pubDate>Fri, 30 Aug 2024 08:27:41 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webアプリ]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[楽天API]]></category>
		<category><![CDATA[楽天商品検索API]]></category>
		<guid isPermaLink="false">https://kekenta-it-blog.com/?p=10940</guid>

					<description><![CDATA[<p><img src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/eye-catch__php-rakuten-api__10940-1024x576.jpg" class="webfeedsFeaturedVisual" /></p>楽天では商品情報を外部アプリから取得するための仕組み＝APIがいくつか用意されています。 今回はその内のひとつ「楽天市場商品検索API」をPHPで扱う方法を解説します。 APIとは？ つまり、今回ご紹介する「楽天市場商品 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/eye-catch__php-rakuten-api__10940-1024x576.jpg" class="webfeedsFeaturedVisual" /></p><div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/困った顔-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/困った顔-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>楽天APIを使えば簡単に商品検索機能が作れるって聞いたんだけど、具体的にどうすればいいんだろう……？</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<p>楽天では<strong>商品情報を外部アプリから取得するための仕組み＝API</strong>がいくつか用意されています。</p>



<p>今回はその内のひとつ<strong><span class="swl-marker mark_yellow">「楽天市場商品検索API」をPHPで扱う方法</span></strong>を解説します。</p>



<div class="swell-block-capbox cap_box is-style-shadow"><div class="cap_box_ttl"><span><span data-icon="LsLightbulb" data-id="0" style="--the-icon-svg: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgd2lkdGg9IjFlbSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBhcmlhLWhpZGRlbj0idHJ1ZSIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48cGF0aCBkPSJNMzIgNDYuNUgxNmMtMS4xIDAtMi0uOS0yLTJzLjktMiAyLTJoMTZjMS4xIDAgMiAuOSAyIDJzLS45IDItMiAyek00MS43IDE1LjlDNDEuMyAxMyA0MCAxMC4zIDM4LjIgOCAzNC41IDMuMiAyOSAuOCAyMy4xIDEgMTQgMS40IDYuNSA4LjkgNiAxOGMtLjMgNiAyLjQgMTEuNyA3LjIgMTUuNC41LjQuOC45LjggMS41djEuNmMwIDIuMiAxLjggNCA0IDRoMTJjMi4yIDAgNC0xLjggNC00VjM1YzAtLjYuMy0xLjIuOS0xLjcgNS4zLTQgOC0xMC42IDYuOC0xNy40em0tNy4xIDEuN2gtLjNjLS43IDAtMS4zLS41LTEuNS0xLjItLjctMy4yLTMuMi01LjctNi40LTYuMy0uOC0uMS0xLjQtLjktMS4yLTEuN3MuOS0xLjQgMS43LTEuMmM0LjQuOCA4IDQuMiA4LjkgOC42LjEuOC0uNCAxLjYtMS4yIDEuOHoiPjwvcGF0aD48L3N2Zz4=)" aria-hidden="true" class="swl-inline-icon"> </span><strong>この記事で分かること</strong></span></div><div class="cap_box_content">
<ul class="wp-block-list is-style-check_list -list-under-dashed">
<li>APIとは何か？</li>



<li>楽天API使用してPHPで自分のWebサイト（アプリ）上に「楽天商品の検索機能」を実装する方法</li>
</ul>
</div></div>


<div class="swell-block-postLink">			<a href="https://kekenta-it-blog.com/alone-php-study/" class="c-blogLink -internal" data-style="text">
				<!-- <i class="c-blogLink__icon icon-link" role="presentation"></i> -->
				<span class="c-blogLink__icon">
					<svg xmlns="http://www.w3.org/2000/svg" class="swl-svg-link __svg" width="1em" height="1em" viewBox="0 0 48 48" role="img" aria-hidden="true" focusable="false"><path d="M21.2 30.2c-.5 0-1-.2-1.4-.6l-.7-.7c-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l7.1-7.1c2.3-2.3 5.3-3.5 8.5-3.5s6.2 1.2 8.5 3.5c4.7 4.7 4.7 12.3 0 17l-3.5 3.5c-.8.8-2 .8-2.8 0-.8-.8-.8-2 0-2.8l3.5-3.5c3.1-3.1 3.1-8.2 0-11.3-1.5-1.5-3.5-2.3-5.7-2.3-2.1 0-4.2.8-5.7 2.3l-7.1 7.1c-1.5 1.5-2.3 3.5-2.3 5.7s.8 4.2 2.3 5.7l.7.7c.8.8.8 2 0 2.8-.4.3-.9.5-1.4.5z" /><path d="M13.4 46.6c-3.1 0-6.1-1.2-8.5-3.5-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l3.5-3.5c.8-.8 2-.8 2.8 0 .8.8.8 2 0 2.8l-3.5 3.5c-1.5 1.5-2.3 3.5-2.3 5.7 0 2.1.8 4.2 2.3 5.7 3.1 3.1 8.2 3.1 11.3 0l7.1-7.1c1.5-1.5 2.3-3.5 2.3-5.7 0-2.1-.8-4.2-2.3-5.7l-.7-.7c-.8-.8-.8-2 0-2.8.8-.8 2-.8 2.8 0l.7.7c2.3 2.3 3.5 5.3 3.5 8.5s-1.2 6.2-3.5 8.5l-7.1 7.1c-2.3 2.3-5.3 3.5-8.4 3.5z" /></svg>				</span>
				<span class="c-blogLink__text">PHPはこうして習得した！約１年間の勉強内容【プログラミング独学】</span>
			</a>
		</div>

<div class="swell-block-postLink">			<a href="https://kekenta-it-blog.com/php-deploy-xserver-for-zip/" class="c-blogLink -internal" data-style="text">
				<!-- <i class="c-blogLink__icon icon-link" role="presentation"></i> -->
				<span class="c-blogLink__icon">
					<svg xmlns="http://www.w3.org/2000/svg" class="swl-svg-link __svg" width="1em" height="1em" viewBox="0 0 48 48" role="img" aria-hidden="true" focusable="false"><path d="M21.2 30.2c-.5 0-1-.2-1.4-.6l-.7-.7c-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l7.1-7.1c2.3-2.3 5.3-3.5 8.5-3.5s6.2 1.2 8.5 3.5c4.7 4.7 4.7 12.3 0 17l-3.5 3.5c-.8.8-2 .8-2.8 0-.8-.8-.8-2 0-2.8l3.5-3.5c3.1-3.1 3.1-8.2 0-11.3-1.5-1.5-3.5-2.3-5.7-2.3-2.1 0-4.2.8-5.7 2.3l-7.1 7.1c-1.5 1.5-2.3 3.5-2.3 5.7s.8 4.2 2.3 5.7l.7.7c.8.8.8 2 0 2.8-.4.3-.9.5-1.4.5z" /><path d="M13.4 46.6c-3.1 0-6.1-1.2-8.5-3.5-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l3.5-3.5c.8-.8 2-.8 2.8 0 .8.8.8 2 0 2.8l-3.5 3.5c-1.5 1.5-2.3 3.5-2.3 5.7 0 2.1.8 4.2 2.3 5.7 3.1 3.1 8.2 3.1 11.3 0l7.1-7.1c1.5-1.5 2.3-3.5 2.3-5.7 0-2.1-.8-4.2-2.3-5.7l-.7-.7c-.8-.8-.8-2 0-2.8.8-.8 2-.8 2.8 0l.7.7c2.3 2.3 3.5 5.3 3.5 8.5s-1.2 6.2-3.5 8.5l-7.1 7.1c-2.3 2.3-5.3 3.5-8.4 3.5z" /></svg>				</span>
				<span class="c-blogLink__text">【PHP】エックスサーバーへデプロイする方法【初心者でも簡単！】</span>
			</a>
		</div>

<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type2" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2025/03/eye-catch__school-php-and-wp__14099-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://kekenta-it-blog.com/school-php-and-wp/">PHPやWordPressを学ぶのにおすすめのプログラミングスクール【７選】</a>
						<span class="p-blogCard__excerpt">僕はこれまで独学でPHPを学習してきました。結論から言えば、それでもPHPを習得することはできました。 しかし、それに費やした累計学習期間は1年ほど。モチベーション&#8230;</span>					</div>
				</div>
			</div>
		</div>


<h2 class="wp-block-heading">APIとは？</h2>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>まずは、「そもそもAPIとは何か？」についてお伝えします！</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<div class="swell-block-capbox cap_box is-style-shadow" data-colset="col1"><div class="cap_box_ttl"><span><strong>API（Application Programming Interface）とは？</strong></span></div><div class="cap_box_content">
<p><strong>2つのアプリ同士が情報をやり取りする際に使用される、プログラミング上の専用通路のこと</strong></p>
</div></div>



<p>つまり、今回ご紹介する「楽天市場商品検索API」は<strong>外部アプリが楽天市場の商品情報を取得するためのAPI</strong>です。</p>


<div class="wp-block-image is-style-shadow">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="447" src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api01-1024x447.jpg" alt="APIの仕組み①（例）楽天API" class="wp-image-11002" srcset="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api01-1024x447.jpg 1024w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api01-300x131.jpg 300w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api01-768x335.jpg 768w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api01.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">APIの仕組み①（例）楽天API</figcaption></figure>
</div>


<p class="is-style-icon_pen">「商品情報を取得するためのAPI」とお伝えしましたが、もう少し正確に言うと、「『商品情報検索機能』を使用するためのAPI」です。<br>商品情報そのものというよりも、<strong>商品情報を取得するための機能を借りるイメージ</strong>です。</p>



<h2 class="wp-block-heading">APIを使用するためには「ID情報」が必要</h2>



<p class="is-style-bg_stripe">APIを使用するためには、基本的に<strong>そのAPIを使用するための「ID情報」が必要</strong>になります。</p>



<p>ID情報とは、もう少し別の言い方をすると「通行許可証」のことです。</p>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>APIは、<strong>外部アプリへ商品情報などを受け渡す通路</strong>です。<br>そのため、「通行許可証＝ID情報」を発行することで、APIの使用許可を出しています。</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<p class="is-style-big_icon_check">APIの使用者は、この「通行許可証＝ID情報」をプログラムを通して提示することにより、初めて<strong><span class="swl-marker mark_yellow">情報取得の許可を得ることができる</span></strong>ということです。</p>


<div class="wp-block-image is-style-shadow">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="447" src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api02-1024x447.jpg" alt="APIの仕組み②（例）楽天API" class="wp-image-11003" srcset="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api02-1024x447.jpg 1024w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api02-300x131.jpg 300w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api02-768x335.jpg 768w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api02.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">APIの仕組み②（例）楽天API</figcaption></figure>
</div>

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4374558503914683"
     crossorigin="anonymous"></script>
<!-- ディスプレイ【横長】 -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-4374558503914683"
     data-ad-slot="9744298852"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">【手順】PHPで楽天APIを使用する主な手順</h2>



<p>「APIとは何か？」を理解できたところで、実際に<strong>PHPで楽天APIを使用する主な手順</strong>をお伝えします。</p>



<div class="swell-block-capbox cap_box is-style-shadow"><div class="cap_box_ttl"><span><span data-icon="LsLightbulb" data-id="0" style="--the-icon-svg: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgd2lkdGg9IjFlbSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBhcmlhLWhpZGRlbj0idHJ1ZSIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48cGF0aCBkPSJNMzIgNDYuNUgxNmMtMS4xIDAtMi0uOS0yLTJzLjktMiAyLTJoMTZjMS4xIDAgMiAuOSAyIDJzLS45IDItMiAyek00MS43IDE1LjlDNDEuMyAxMyA0MCAxMC4zIDM4LjIgOCAzNC41IDMuMiAyOSAuOCAyMy4xIDEgMTQgMS40IDYuNSA4LjkgNiAxOGMtLjMgNiAyLjQgMTEuNyA3LjIgMTUuNC41LjQuOC45LjggMS41djEuNmMwIDIuMiAxLjggNCA0IDRoMTJjMi4yIDAgNC0xLjggNC00VjM1YzAtLjYuMy0xLjIuOS0xLjcgNS4zLTQgOC0xMC42IDYuOC0xNy40em0tNy4xIDEuN2gtLjNjLS43IDAtMS4zLS41LTEuNS0xLjItLjctMy4yLTMuMi01LjctNi40LTYuMy0uOC0uMS0xLjQtLjktMS4yLTEuN3MuOS0xLjQgMS43LTEuMmM0LjQuOCA4IDQuMiA4LjkgOC42LjEuOC0uNCAxLjYtMS4yIDEuOHoiPjwvcGF0aD48L3N2Zz4=)" aria-hidden="true" class="swl-inline-icon"> </span><strong> PHPで楽天APIを使用する主な手順</strong></span></div><div class="cap_box_content">
<ul class="wp-block-list is-style-num_circle -list-under-dashed">
<li>楽天DevelopersでアプリIDを発行する</li>



<li>必要な「SDK」をプロジェクトディレクトリへ導入する</li>



<li>ソースコードを記述する</li>
</ul>
</div></div>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>以下よりひとつずつ丁寧に解説していきます！</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<h2 class="wp-block-heading">STEP1　楽天DevelopersでアプリIDを発行する</h2>



<p>前述のとおり、APIを使用するためには「通行許可証＝ID情報」が必要です。</p>



<p>楽天APIを使用するときも、まずは<strong>楽天アプリIDを発行</strong>する必要があります。</p>



<div class="swell-block-capbox cap_box is-style-shadow"><div class="cap_box_ttl"><span><span data-icon="LsLightbulb" data-id="0" style="--the-icon-svg: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgd2lkdGg9IjFlbSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBhcmlhLWhpZGRlbj0idHJ1ZSIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48cGF0aCBkPSJNMzIgNDYuNUgxNmMtMS4xIDAtMi0uOS0yLTJzLjktMiAyLTJoMTZjMS4xIDAgMiAuOSAyIDJzLS45IDItMiAyek00MS43IDE1LjlDNDEuMyAxMyA0MCAxMC4zIDM4LjIgOCAzNC41IDMuMiAyOSAuOCAyMy4xIDEgMTQgMS40IDYuNSA4LjkgNiAxOGMtLjMgNiAyLjQgMTEuNyA3LjIgMTUuNC41LjQuOC45LjggMS41djEuNmMwIDIuMiAxLjggNCA0IDRoMTJjMi4yIDAgNC0xLjggNC00VjM1YzAtLjYuMy0xLjIuOS0xLjcgNS4zLTQgOC0xMC42IDYuOC0xNy40em0tNy4xIDEuN2gtLjNjLS43IDAtMS4zLS41LTEuNS0xLjItLjctMy4yLTMuMi01LjctNi40LTYuMy0uOC0uMS0xLjQtLjktMS4yLTEuN3MuOS0xLjQgMS43LTEuMmM0LjQuOCA4IDQuMiA4LjkgOC42LjEuOC0uNCAxLjYtMS4yIDEuOHoiPjwvcGF0aD48L3N2Zz4=)" aria-hidden="true" class="swl-inline-icon"> </span><strong> 楽天DevelopersでアプリIDを発行する手順</strong></span></div><div class="cap_box_content">
<ul class="wp-block-list is-style-num_circle -list-under-dashed">
<li><a href="https://www.rakuten.co.jp/myrakuten/help/">楽天</a>に会員登録する</li>



<li><a href="https://webservice.rakuten.co.jp">楽天Developers</a>に楽天会員情報でログインする</li>



<li>ヘッダ―メニューにある「アプリID発行」からアプリIDの新規発行を進める</li>
</ul>
</div></div>



<p class="is-style-icon_info">手順③でアプリIDを発行する際には、<strong>APIを使用するWebサイト（アプリ）のURL情報</strong>を入力する必要があります。</p>



<p class="is-style-bg_stripe">【楽天Developers】<a href="https://webservice.rakuten.co.jp">https://webservice.rakuten.co.jp</a></p>



<p>なお、すでに楽天会員の方は、<strong>手順②</strong>から進めていただければ大丈夫です。</p>



<p class="has-text-align-center is-style-balloon_box">【<strong>参考</strong>】<strong>手順③「アプリID発行」</strong></p>


<div class="wp-block-image is-style-browser_mac size_s">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="812" src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api03-1024x812.jpg" alt="アプリIDの発行" class="wp-image-11000" srcset="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api03-1024x812.jpg 1024w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api03-300x238.jpg 300w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api03-768x609.jpg 768w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api03.jpg 1109w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">アプリIDの発行</figcaption></figure>
</div>


<h2 class="wp-block-heading">STEP2　必要な「SDK」をプロジェクトディレクトリへ導入する</h2>



<p class="is-style-bg_stripe">PHPで楽天APIを簡単に利用できるようにするための「SDK」を<strong>ダウンロード＆プロジェクトディレクトリへ配置</strong>します。</p>



<div class="swell-block-capbox cap_box is-style-shadow" data-colset="col1"><div class="cap_box_ttl"><span><span style="--the-icon-svg: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgd2lkdGg9IjFlbSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBhcmlhLWhpZGRlbj0idHJ1ZSIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48cGF0aCBkPSJNMzIgNDYuNUgxNmMtMS4xIDAtMi0uOS0yLTJzLjktMiAyLTJoMTZjMS4xIDAgMiAuOSAyIDJzLS45IDItMiAyek00MS43IDE1LjlDNDEuMyAxMyA0MCAxMC4zIDM4LjIgOCAzNC41IDMuMiAyOSAuOCAyMy4xIDEgMTQgMS40IDYuNSA4LjkgNiAxOGMtLjMgNiAyLjQgMTEuNyA3LjIgMTUuNC41LjQuOC45LjggMS41djEuNmMwIDIuMiAxLjggNCA0IDRoMTJjMi4yIDAgNC0xLjggNC00VjM1YzAtLjYuMy0xLjIuOS0xLjcgNS4zLTQgOC0xMC42IDYuOC0xNy40em0tNy4xIDEuN2gtLjNjLS43IDAtMS4zLS41LTEuNS0xLjItLjctMy4yLTMuMi01LjctNi40LTYuMy0uOC0uMS0xLjQtLjktMS4yLTEuN3MuOS0xLjQgMS43LTEuMmM0LjQuOCA4IDQuMiA4LjkgOC42LjEuOC0uNCAxLjYtMS4yIDEuOHoiPjwvcGF0aD48L3N2Zz4=)" data-icon="LsLightbulb" data-id="0" aria-hidden="true" class="swl-inline-icon"> </span><strong>SDKとは？</strong></span></div><div class="cap_box_content">
<p><strong>SDK（Software Development Kit）</strong>は、日本語で「ソフトウェア開発キット」のことです。</p>



<p><strong>ソフトウェアを開発する際に必要なプログラムやAPIなどをまとめてパッケージ化したもの</strong>を「SDK」と呼びます。</p>



<p class="is-style-bg_stripe">今回ご紹介する楽天APIでは<strong>Rakuten Web Service SDK for PHP</strong>というSDKを利用します。</p>
</div></div>



<p class="is-style-icon_info">なお、本章でご紹介するSDKの導入手順は、<strong>Composerでのインストールを手動化したもの</strong>です。<br>Composerを使ったことが無い方向けに、あえて手動での手順をご紹介しています。</p>



<p class="is-style-balloon_box">Composerについて知りたい方向けの記事</p>



<div class="wp-block-group has-border -border01"><div class="wp-block-group__inner-container"><div class="swell-block-postLink">			<a href="https://kekenta-it-blog.com/composer-install/" class="c-blogLink -internal" data-style="text">
				<!-- <i class="c-blogLink__icon icon-link" role="presentation"></i> -->
				<span class="c-blogLink__icon">
					<svg xmlns="http://www.w3.org/2000/svg" class="swl-svg-link __svg" width="1em" height="1em" viewBox="0 0 48 48" role="img" aria-hidden="true" focusable="false"><path d="M21.2 30.2c-.5 0-1-.2-1.4-.6l-.7-.7c-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l7.1-7.1c2.3-2.3 5.3-3.5 8.5-3.5s6.2 1.2 8.5 3.5c4.7 4.7 4.7 12.3 0 17l-3.5 3.5c-.8.8-2 .8-2.8 0-.8-.8-.8-2 0-2.8l3.5-3.5c3.1-3.1 3.1-8.2 0-11.3-1.5-1.5-3.5-2.3-5.7-2.3-2.1 0-4.2.8-5.7 2.3l-7.1 7.1c-1.5 1.5-2.3 3.5-2.3 5.7s.8 4.2 2.3 5.7l.7.7c.8.8.8 2 0 2.8-.4.3-.9.5-1.4.5z" /><path d="M13.4 46.6c-3.1 0-6.1-1.2-8.5-3.5-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l3.5-3.5c.8-.8 2-.8 2.8 0 .8.8.8 2 0 2.8l-3.5 3.5c-1.5 1.5-2.3 3.5-2.3 5.7 0 2.1.8 4.2 2.3 5.7 3.1 3.1 8.2 3.1 11.3 0l7.1-7.1c1.5-1.5 2.3-3.5 2.3-5.7 0-2.1-.8-4.2-2.3-5.7l-.7-.7c-.8-.8-.8-2 0-2.8.8-.8 2-.8 2.8 0l.7.7c2.3 2.3 3.5 5.3 3.5 8.5s-1.2 6.2-3.5 8.5l-7.1 7.1c-2.3 2.3-5.3 3.5-8.4 3.5z" /></svg>				</span>
				<span class="c-blogLink__text">【Windows】Composerのインストール方法｜エラー時の対処も解説</span>
			</a>
		</div>

<div class="swell-block-postLink">			<a href="https://kekenta-it-blog.com/composer-how-to/" class="c-blogLink -internal" data-style="text">
				<!-- <i class="c-blogLink__icon icon-link" role="presentation"></i> -->
				<span class="c-blogLink__icon">
					<svg xmlns="http://www.w3.org/2000/svg" class="swl-svg-link __svg" width="1em" height="1em" viewBox="0 0 48 48" role="img" aria-hidden="true" focusable="false"><path d="M21.2 30.2c-.5 0-1-.2-1.4-.6l-.7-.7c-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l7.1-7.1c2.3-2.3 5.3-3.5 8.5-3.5s6.2 1.2 8.5 3.5c4.7 4.7 4.7 12.3 0 17l-3.5 3.5c-.8.8-2 .8-2.8 0-.8-.8-.8-2 0-2.8l3.5-3.5c3.1-3.1 3.1-8.2 0-11.3-1.5-1.5-3.5-2.3-5.7-2.3-2.1 0-4.2.8-5.7 2.3l-7.1 7.1c-1.5 1.5-2.3 3.5-2.3 5.7s.8 4.2 2.3 5.7l.7.7c.8.8.8 2 0 2.8-.4.3-.9.5-1.4.5z" /><path d="M13.4 46.6c-3.1 0-6.1-1.2-8.5-3.5-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l3.5-3.5c.8-.8 2-.8 2.8 0 .8.8.8 2 0 2.8l-3.5 3.5c-1.5 1.5-2.3 3.5-2.3 5.7 0 2.1.8 4.2 2.3 5.7 3.1 3.1 8.2 3.1 11.3 0l7.1-7.1c1.5-1.5 2.3-3.5 2.3-5.7 0-2.1-.8-4.2-2.3-5.7l-.7-.7c-.8-.8-.8-2 0-2.8.8-.8 2-.8 2.8 0l.7.7c2.3 2.3 3.5 5.3 3.5 8.5s-1.2 6.2-3.5 8.5l-7.1 7.1c-2.3 2.3-5.3 3.5-8.4 3.5z" /></svg>				</span>
				<span class="c-blogLink__text">【初心者向け】Composerの使い方を丁寧に解説！【PHP】</span>
			</a>
		</div></div></div>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>以下より<strong>SDKの導入手順</strong>をステップごとにお伝えします！</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<div class="swell-block-step" data-num-style="circle">
<div class="swell-block-step__item"><div class="swell-block-step__number u-bg-main"><span class="__label">STEP</span></div><div class="swell-block-step__title u-fz-l">「SDK」のzipファイルをダウンロードする</div><div class="swell-block-step__body">
<p class="is-style-bg_stripe">以下のGithubページから<strong>「SDK」のzipファイルをダウンロードします。</strong></p>



<p><a href="https://github.com/rakuten-ws/rws-php-sdk/blob/master/README.md">https://github.com/rakuten-ws/rws-php-sdk/blob/master/README.md</a></p>


<div class="wp-block-image is-style-browser_mac">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="714" src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api04-1024x714.jpg" alt="SDKのダウンロード" class="wp-image-10999" srcset="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api04-1024x714.jpg 1024w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api04-300x209.jpg 300w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api04-768x536.jpg 768w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api04.jpg 1322w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">SDKのダウンロード</figcaption></figure>
</div></div></div>



<div class="swell-block-step__item"><div class="swell-block-step__number u-bg-main"><span class="__label">STEP</span></div><div class="swell-block-step__title u-fz-l">ダウンロードしたzipファイルを解凍する</div><div class="swell-block-step__body">

</div></div>



<div class="swell-block-step__item"><div class="swell-block-step__number u-bg-main"><span class="__label">STEP</span></div><div class="swell-block-step__title u-fz-l">必要なファイルをプロジェクトディレクトリへ配置する</div><div class="swell-block-step__body">
<p class="is-style-bg_stripe">解凍ができたら、必要なファイルをプロジェクトディレクトリへ配置します。</p>



<div class="swell-block-capbox cap_box is-style-onborder_ttl2"><div class="cap_box_ttl"><span>プロジェクトディレクトリへ配置するファイル<span data-icon="LsFile" data-id="21" style="--the-icon-svg: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgd2lkdGg9IjFlbSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBhcmlhLWhpZGRlbj0idHJ1ZSIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48cGF0aCBkPSJtNDEuNSAxMS43LTguMi04LjJjLS45LTEtMi4yLTEuNS0zLjUtMS41SDEwQzcuMiAyIDUgNC4yIDUgN3YzNGMwIDIuOCAyLjIgNSA1IDVoMjhjMi44IDAgNS0yLjIgNS01VjE1LjJjMC0xLjMtLjUtMi41LTEuNS0zLjV6TTMxIDYuOGw3LjIgNy4ySDMyYy0uNiAwLTEtLjQtMS0xVjYuOHpNMzggNDJIMTBjLS42IDAtMS0uNC0xLTFWN2MwLS42LjQtMSAxLTFoMTd2N2MwIDIuOCAyLjIgNSA1IDVoN3YyM2MwIC42LS40IDEtMSAxeiI+PC9wYXRoPjwvc3ZnPg==)" aria-hidden="true" class="swl-inline-icon"> </span></span></div><div class="cap_box_content">
<ul class="wp-block-list is-style-num_circle -list-under-dashed">
<li><code class="dir_name">lib</code>ディレクトリ</li>



<li><code class="file_name">autoload.php</code>ファイル</li>
</ul>
</div></div>


<div class="wp-block-image is-style-shadow">
<figure class="aligncenter size-full"><img decoding="async" width="729" height="366" src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api06.jpg" alt="プロジェクトディレクトリへ必要なファイルを移動" class="wp-image-11009" srcset="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api06.jpg 729w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api06-300x151.jpg 300w" sizes="(max-width: 729px) 100vw, 729px" /><figcaption class="wp-element-caption">プロジェクトディレクトリへ必要なファイルを移動</figcaption></figure>
</div></div></div>
</div>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>以上で<strong>SDKの導入（インストール）は完了</strong>です！</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4374558503914683"
     crossorigin="anonymous"></script>
<!-- ディスプレイ【横長】 -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-4374558503914683"
     data-ad-slot="9744298852"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">STEP3　ソースコードを記述する</h2>



<p class="is-style-bg_stripe"><strong><span class="swl-marker mark_yellow">楽天APIで商品検索機能を作成するソースコード</span></strong>は以下の通りです。<br>※詳しい解説は後述します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-file="index.php" data-lang="PHP"><code>&lt;?php

//「Deprecated：～」というエラーが表示されたら下記を記述する
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);

require_once dirname(__FILE__) . &#39;/autoload.php&#39;; 

// 検索キーワード設定
$keyword = &quot;PHP&quot;;
if( isset( $_GET[&#39;keyword&#39;] ) ) $keyword = $_GET[&#39;keyword&#39;];

// 楽天APIクライアントの生成
$client = new RakutenRws_Client();
$client-&gt;setApplicationId( &#39;アプリID&#39; );  // アプリID

//入力パラメータを指定
$response = $client-&gt;execute(&#39;IchibaItemSearch&#39;, array(
  &#39;keyword&#39; =&gt; $keyword,  // キーワード
  &#39;hits&#39; =&gt; &#39;20&#39;,         // 検索件数
  &#39;page&#39; =&gt; &#39;1&#39;,          // 全検索結果中の内、「何ページ目」の結果を表示するか
  &#39;imageFlag&#39; =&gt; &#39;1&#39;,     // 商品画像ありの商品のみを検索対象とする ※「画像なし」も含みたいときは「0」を指定
  &#39;affiliateId&#39; =&gt; &#39;アフィリエイトID&#39;, // アフィリエイトID ※アフィリエイト用リンクが不要のときは削除
));

$html = &#39;&#39;;
if ($response-&gt;isOk()) {

  //検索結果を1件ずつチェック
  $html .= &#39;&lt;ul&gt;&#39;;

  foreach ($response as $item) {
    // 出力パラメータをキーとして結果を参照する
    $html .= &#39;&lt;li&gt;&#39;;
    $html .=   &#39;&lt;a href=&quot;&#39; . $item[&#39;affiliateUrl&#39;] . &#39;&quot;&gt;&#39;;
    $html .=     &#39;&lt;img src=&quot;&#39; . $item[&#39;mediumImageUrls&#39;][0][&quot;imageUrl&quot;] . &#39;&quot;&gt;&#39;;
    $html .=     &#39;&lt;h3&gt;&#39; . $item[&#39;itemName&#39;] . &#39;&lt;/h3&gt;&#39;;
    $html .=   &#39;&lt;/a&gt;&#39;;
    $html .= &#39;&lt;/li&gt;&#39;;
    $html .= &#39;&lt;hr&gt;&#39;;
  }
  $html .= &#39;&lt;/ul&gt;&#39;;
} else {
  echo $html .= &#39;予期しないエラーが発生しました。&#39;;
}

?&gt;

&lt;!-- 検索フォーム --&gt;
&lt;form action=&quot;&quot; method=&quot;get&quot;&gt;
    &lt;input type=&quot;text&quot; name=&quot;keyword&quot; placeholder=&quot;検索キーワード&quot; value=&quot;&lt;?php echo htmlspecialchars( $keyword, ENT_QUOTES, &quot;UTF-8&quot; ); ?&gt;&quot;&gt;
    &lt;input type=&quot;submit&quot; value=&quot;検索&quot;&gt;
&lt;/form&gt;
&lt;hr&gt;
&lt;hr&gt;

&lt;!-- 取得情報の出力 --&gt;
&lt;?php echo $html; ?&gt;
</code></pre></div>



<div class="wp-block-group is-style-big_icon_good"><div class="wp-block-group__inner-container">
<p class="is-style-bg_stripe">「アプリID」と「アフィリエイトID」は、<strong>楽天Developersの「アプリ情報の確認」</strong>からご確認いただけます。</p>


<div class="wp-block-image is-style-browser_mac">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="407" src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api05-1024x407.jpg" alt="アプリID・アフィリエイトIDの確認" class="wp-image-11001" srcset="https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api05-1024x407.jpg 1024w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api05-300x119.jpg 300w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api05-768x305.jpg 768w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/php-rakuten-api05.jpg 1345w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">アプリID・アフィリエイトIDの確認</figcaption></figure>
</div></div></div>



<p class="has-text-align-center is-style-balloon_box"><span data-icon="LsLightbulb" data-id="0" style="--the-icon-svg: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgd2lkdGg9IjFlbSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBhcmlhLWhpZGRlbj0idHJ1ZSIgdmlld0JveD0iMCAwIDQ4IDQ4Ij48cGF0aCBkPSJNMzIgNDYuNUgxNmMtMS4xIDAtMi0uOS0yLTJzLjktMiAyLTJoMTZjMS4xIDAgMiAuOSAyIDJzLS45IDItMiAyek00MS43IDE1LjlDNDEuMyAxMyA0MCAxMC4zIDM4LjIgOCAzNC41IDMuMiAyOSAuOCAyMy4xIDEgMTQgMS40IDYuNSA4LjkgNiAxOGMtLjMgNiAyLjQgMTEuNyA3LjIgMTUuNC41LjQuOC45LjggMS41djEuNmMwIDIuMiAxLjggNCA0IDRoMTJjMi4yIDAgNC0xLjggNC00VjM1YzAtLjYuMy0xLjIuOS0xLjcgNS4zLTQgOC0xMC42IDYuOC0xNy40em0tNy4xIDEuN2gtLjNjLS43IDAtMS4zLS41LTEuNS0xLjItLjctMy4yLTMuMi01LjctNi40LTYuMy0uOC0uMS0xLjQtLjktMS4yLTEuN3MuOS0xLjQgMS43LTEuMmM0LjQuOCA4IDQuMiA4LjkgOC42LjEuOC0uNCAxLjYtMS4yIDEuOHoiPjwvcGF0aD48L3N2Zz4=)" aria-hidden="true" class="swl-inline-icon"> </span><strong>出力結果</strong></p>


<div class="wp-block-image is-style-browser_mac size_xs">
<figure class="aligncenter size-full"><img decoding="async" width="804" height="701" src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/image-9.png" alt="楽天APIの出力結果" class="wp-image-11033" srcset="https://kekenta-it-blog.com/wp-content/uploads/2024/08/image-9.png 804w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/image-9-300x262.png 300w, https://kekenta-it-blog.com/wp-content/uploads/2024/08/image-9-768x670.png 768w" sizes="(max-width: 804px) 100vw, 804px" /><figcaption class="wp-element-caption">楽天APIの出力結果</figcaption></figure>
</div>


<h2 class="wp-block-heading">【解説】「商品検索機能」のソースコード</h2>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>本章では前章でご提示した<strong><span class="swl-marker mark_yellow">ソースコードの解説</span></strong>をしていきます！</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<p class="is-style-balloon_box"><strong>エラー表示対策</strong><br>※本筋であるAPI連携とはあまり関係のない処理です。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-file="index.php" data-lang="PHP"><code>//「Deprecated：～」というエラーが表示されたら下記を記述する
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);</code></pre></div>



<p class="is-style-big_icon_check">今回使用するSDKの中で非推奨関数が使用されており、環境によっては「Deprecated：～」というエラーが表示されてしまいます。<br>上記のコードは、それを非表示にするための処置です。</p>



<p class="is-style-balloon_box"><strong>APIを利用するファイルにインストールしたSDKのファイル読み込み</strong><br>※autoload.phpまでのパスを記述</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-file="index.php" data-lang="PHP"><code>require_once dirname(__FILE__) . &#39;/autoload.php&#39;; </code></pre></div>



<div class="swell-block-capbox cap_box is-style-onborder_ttl2"><div class="cap_box_ttl"><span>autoload.phpとは？</span></div><div class="cap_box_content">
<p>Composerの機能のひとつ<strong>「オートロード」を利用するためのファイル</strong>です。<br>詳しい内容が知りたい方は以下の記事をご覧ください。</p>


<div class="swell-block-postLink">			<a href="https://kekenta-it-blog.com/composer-how-to/" class="c-blogLink -internal" data-style="text">
				<!-- <i class="c-blogLink__icon icon-link" role="presentation"></i> -->
				<span class="c-blogLink__icon">
					<svg xmlns="http://www.w3.org/2000/svg" class="swl-svg-link __svg" width="1em" height="1em" viewBox="0 0 48 48" role="img" aria-hidden="true" focusable="false"><path d="M21.2 30.2c-.5 0-1-.2-1.4-.6l-.7-.7c-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l7.1-7.1c2.3-2.3 5.3-3.5 8.5-3.5s6.2 1.2 8.5 3.5c4.7 4.7 4.7 12.3 0 17l-3.5 3.5c-.8.8-2 .8-2.8 0-.8-.8-.8-2 0-2.8l3.5-3.5c3.1-3.1 3.1-8.2 0-11.3-1.5-1.5-3.5-2.3-5.7-2.3-2.1 0-4.2.8-5.7 2.3l-7.1 7.1c-1.5 1.5-2.3 3.5-2.3 5.7s.8 4.2 2.3 5.7l.7.7c.8.8.8 2 0 2.8-.4.3-.9.5-1.4.5z" /><path d="M13.4 46.6c-3.1 0-6.1-1.2-8.5-3.5-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l3.5-3.5c.8-.8 2-.8 2.8 0 .8.8.8 2 0 2.8l-3.5 3.5c-1.5 1.5-2.3 3.5-2.3 5.7 0 2.1.8 4.2 2.3 5.7 3.1 3.1 8.2 3.1 11.3 0l7.1-7.1c1.5-1.5 2.3-3.5 2.3-5.7 0-2.1-.8-4.2-2.3-5.7l-.7-.7c-.8-.8-.8-2 0-2.8.8-.8 2-.8 2.8 0l.7.7c2.3 2.3 3.5 5.3 3.5 8.5s-1.2 6.2-3.5 8.5l-7.1 7.1c-2.3 2.3-5.3 3.5-8.4 3.5z" /></svg>				</span>
				<span class="c-blogLink__text">【初心者向け】Composerの使い方を丁寧に解説！【PHP】</span>
			</a>
		</div></div></div>



<p class="is-style-balloon_box"><strong>検索キーワードを取得</strong><br>※初めてページが開かれたときは「PHP」をキーワードとして設定</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-file="index.php" data-lang="PHP"><code>// 検索キーワード設定
$keyword = &quot;PHP&quot;;
if( isset( $_GET[&#39;keyword&#39;] ) ) $keyword = $_GET[&#39;keyword&#39;];</code></pre></div>



<p class="is-style-balloon_box"><strong>楽天APIで商品情報を取得するために必要な各種情報を設定</strong></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-file="index.php" data-lang="PHP"><code>// 楽天APIクライアントの生成
$client = new RakutenRws_Client();
$client-&gt;setApplicationId( &#39;アプリID&#39; );  // アプリID

//入力パラメータを指定
$response = $client-&gt;execute(&#39;IchibaItemSearch&#39;, array(
  &#39;keyword&#39; =&gt; $keyword,  // キーワード
  &#39;hits&#39; =&gt; &#39;20&#39;,         // 検索件数
  &#39;page&#39; =&gt; &#39;1&#39;,          // 全検索結果中の内、「何ページ目」の結果を表示するか
  &#39;imageFlag&#39; =&gt; &#39;1&#39;,     // 商品画像ありの商品のみを検索対象とする ※「画像なし」も含みたいときは「0」を指定
  &#39;affiliateId&#39; =&gt; &#39;アフィリエイトID&#39;, // アフィリエイトID ※アフィリエイト用リンクが不要のときは削除
));</code></pre></div>



<p class="is-style-big_icon_check">「入力パラメータ」については<a href="https://webservice.rakuten.co.jp/documentation/ichiba-item-search">公式ドキュメント</a>をご参照下さい。<br>■楽天商品検索API：<a href="https://webservice.rakuten.co.jp/documentation/ichiba-item-search">https://webservice.rakuten.co.jp/documentation/ichiba-item-search</a>&nbsp;</p>



<p class="is-style-balloon_box"><strong>楽天APIからのレスポンス（商品情報）を受け取る → HTML出力用変数「$html」に格納</strong></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-file="index.php" data-lang="PHP"><code>$html = &#39;&#39;;
if ($response-&gt;isOk()) {

  //検索結果を1件ずつチェック
  $html .= &#39;&lt;ul&gt;&#39;;

  foreach ($response as $item) {
    // 出力パラメータをキーとして結果を参照する
    $html .= &#39;&lt;li&gt;&#39;;
    $html .=   &#39;&lt;a href=&quot;&#39; . $item[&#39;affiliateUrl&#39;] . &#39;&quot;&gt;&#39;;
    $html .=     &#39;&lt;img src=&quot;&#39; . $item[&#39;mediumImageUrls&#39;][0][&quot;imageUrl&quot;] . &#39;&quot;&gt;&#39;;
    $html .=     &#39;&lt;h3&gt;&#39; . $item[&#39;itemName&#39;] . &#39;&lt;/h3&gt;&#39;;
    $html .=   &#39;&lt;/a&gt;&#39;;
    $html .= &#39;&lt;/li&gt;&#39;;
    $html .= &#39;&lt;hr&gt;&#39;;
  }
  $html .= &#39;&lt;/ul&gt;&#39;;
} else {
  echo $html .= &#39;予期しないエラーが発生しました。&#39;;
}</code></pre></div>



<p class="is-style-big_icon_check">「出力パラメータ」については<a href="https://webservice.rakuten.co.jp/documentation/ichiba-item-search">公式ドキュメント</a>に記載があります。<br><br>……が、記載通りのキーが存在していないことや、キー名が誤っていることがあるため、基本的に<strong><span class="swl-marker mark_yellow">出力パラメータの確認は<code>var_dump()</code>でおこなった方が確実</span></strong>です。</p>



<p class="is-style-icon_pen">上記のソースコードで言うと、ループ内で<strong>var_dump( $item );</strong>とすることで、出力可能なキー名が確認できます。</p>



<p class="is-style-icon_info"><code>affiliateUrl</code>（アフィリエイトリンク）については「入力パラメータ」でアフィリエイトIDを指定しないと出力されません。</p>



<p class="is-style-balloon_box"><strong>検索フォームの設置と取得情報の出力</strong></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-file="index.php" data-lang="PHP"><code>&lt;!-- 検索フォーム --&gt;
&lt;form action=&quot;&quot; method=&quot;get&quot;&gt;
    &lt;input type=&quot;text&quot; name=&quot;keyword&quot; placeholder=&quot;検索キーワード&quot; value=&quot;&lt;?php echo htmlspecialchars( $keyword, ENT_QUOTES, &quot;UTF-8&quot; ); ?&gt;&quot;&gt;
    &lt;input type=&quot;submit&quot; value=&quot;検索&quot;&gt;
&lt;/form&gt;
&lt;hr&gt;
&lt;hr&gt;

&lt;!-- 取得情報の出力 --&gt;
&lt;?php echo $html; ?&gt;</code></pre></div>



<p class="is-style-big_icon_check">この検索フォームにキーワードを入力して「検索」ボタンを押すことで、先ほど登場した「検索キーワード取得処理」に値が受け渡されます。</p>



<p class="is-style-icon_info"><strong>XSS（クロスサイトスクリプティング攻撃）対策</strong>として<code>htmlspecialchars()</code>を使用している点にご留意ください。</p>



<p class="is-style-balloon_box2">XSSについてはこちらの記事をご覧ください。</p>


<div class="swell-block-postLink">			<a href="https://kekenta-it-blog.com/xss-php/" class="c-blogLink -internal" data-style="text">
				<!-- <i class="c-blogLink__icon icon-link" role="presentation"></i> -->
				<span class="c-blogLink__icon">
					<svg xmlns="http://www.w3.org/2000/svg" class="swl-svg-link __svg" width="1em" height="1em" viewBox="0 0 48 48" role="img" aria-hidden="true" focusable="false"><path d="M21.2 30.2c-.5 0-1-.2-1.4-.6l-.7-.7c-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l7.1-7.1c2.3-2.3 5.3-3.5 8.5-3.5s6.2 1.2 8.5 3.5c4.7 4.7 4.7 12.3 0 17l-3.5 3.5c-.8.8-2 .8-2.8 0-.8-.8-.8-2 0-2.8l3.5-3.5c3.1-3.1 3.1-8.2 0-11.3-1.5-1.5-3.5-2.3-5.7-2.3-2.1 0-4.2.8-5.7 2.3l-7.1 7.1c-1.5 1.5-2.3 3.5-2.3 5.7s.8 4.2 2.3 5.7l.7.7c.8.8.8 2 0 2.8-.4.3-.9.5-1.4.5z" /><path d="M13.4 46.6c-3.1 0-6.1-1.2-8.5-3.5-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l3.5-3.5c.8-.8 2-.8 2.8 0 .8.8.8 2 0 2.8l-3.5 3.5c-1.5 1.5-2.3 3.5-2.3 5.7 0 2.1.8 4.2 2.3 5.7 3.1 3.1 8.2 3.1 11.3 0l7.1-7.1c1.5-1.5 2.3-3.5 2.3-5.7 0-2.1-.8-4.2-2.3-5.7l-.7-.7c-.8-.8-.8-2 0-2.8.8-.8 2-.8 2.8 0l.7.7c2.3 2.3 3.5 5.3 3.5 8.5s-1.2 6.2-3.5 8.5l-7.1 7.1c-2.3 2.3-5.3 3.5-8.4 3.5z" /></svg>				</span>
				<span class="c-blogLink__text">【XSS】クロスサイト・スクリプティングとは？対策方法も解説【PHP】</span>
			</a>
		</div>

<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>解説は以上です！　お疲れさまでした！<br>そのほか、<strong>補足事項</strong>がいくつかあるため以下よりご説明していきます。</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4374558503914683"
     crossorigin="anonymous"></script>
<!-- ディスプレイ【横長】 -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-4374558503914683"
     data-ad-slot="9744298852"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">【補足①】特定のショップのみ表示したいとき</h2>



<p>楽天では様々なショップが商品を出品しています。</p>



<p>例えば書籍の場合だと、公式である「楽天ブックス」が取り扱っているものと同じ書籍を出品しているショップがほかにいくつも存在します。</p>



<p>そうすると、<strong><span class="swl-marker mark_yellow">APIで取得する書籍情報が重複してしまうこと</span></strong>がよくあります。</p>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>書籍情報の重複を避ける方法はいくつかありますが、ここでは例として<strong><span class="swl-marker mark_yellow">「楽天ブックス」の商品情報だけを出力する方法</span></strong>をご紹介します。</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<p class="is-style-balloon_box"><strong>「楽天ブックス」以外はすべて除外</strong></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-file="index.php" data-lang="PHP" data-line="9,10"><code>$html = &#39;&#39;;
if ($response-&gt;isOk()) {

  //検索結果を1件ずつチェック
  $html .= &#39;&lt;ul&gt;&#39;;

  foreach ($response as $item) {

    // 楽天ブックス以外は除外
    if ($item[&#39;shopName&#39;] !== &#39;楽天ブックス&#39;) continue;

    // 出力パラメータをキーとして結果を参照する
    $html .= &#39;&lt;li&gt;&#39;;
    $html .=   &#39;&lt;a href=&quot;&#39; . $item[&#39;affiliateUrl&#39;] . &#39;&quot;&gt;&#39;;
    $html .=     &#39;&lt;img src=&quot;&#39; . $item[&#39;mediumImageUrls&#39;][0][&quot;imageUrl&quot;] . &#39;&quot;&gt;&#39;;
    $html .=     &#39;&lt;h3&gt;&#39; . $item[&#39;itemName&#39;] . &#39;&lt;/h3&gt;&#39;;
    $html .=   &#39;&lt;/a&gt;&#39;;
    $html .= &#39;&lt;/li&gt;&#39;;
    $html .= &#39;&lt;hr&gt;&#39;;
  }
  $html .= &#39;&lt;/ul&gt;&#39;;
} else {
  echo $html .= &#39;予期しないエラーが発生しました。&#39;;
}</code></pre></div>



<p class="is-style-icon_pen">ハイライト行を追加しました。</p>



<p class="is-style-icon_good">このように記述することで、<strong><span class="swl-marker mark_blue">楽天ブックス以外の商品情報をスキップ</span></strong>することができます。</p>



<h2 class="wp-block-heading">【補足②】出力する画像サイズを調整したいとき</h2>



<p class="is-style-bg_stripe">楽天APIでは<strong>表示する画像URLも取得することが可能</strong>です。</p>



<p>しかし、元々用意されている画像サイズでは少し小さいと感じる方も恐らく多いかと思います。</p>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/11/kekenta-icon-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/11/kekenta-icon-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>そのようなときは、<strong>以下のコードを追記</strong>することで、<strong><span class="swl-marker mark_yellow">画像サイズを任意のものへ調整することが可能</span></strong>です。</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<p class="is-style-balloon_box"><strong>画像サイズを任意のものへ変更する</strong></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-php" data-file="index.php" data-lang="PHP" data-line="12"><code>$html = &#39;&#39;;
if ($response-&gt;isOk()) {

  //検索結果を1件ずつチェック
  $html .= &#39;&lt;ul&gt;&#39;;

  foreach ($response as $item) {

    // 出力パラメータをキーとして結果を参照する
    $html .= &#39;&lt;li&gt;&#39;;
    $html .=   &#39;&lt;a href=&quot;&#39; . $item[&#39;affiliateUrl&#39;] . &#39;&quot;&gt;&#39;;
    $html .=     &#39;&lt;img src=&quot;&lt;?php echo str_replace(&quot;_ex=128x128&quot;, &quot;_ex=200x200&quot;, $item[&#39;mediumImageUrls&#39;][0][&#39;imageUrl&#39;]); ?&gt;&quot;&gt;&#39;;
    $html .=     &#39;&lt;h3&gt;&#39; . $item[&#39;itemName&#39;] . &#39;&lt;/h3&gt;&#39;;
    $html .=   &#39;&lt;/a&gt;&#39;;
    $html .= &#39;&lt;/li&gt;&#39;;
    $html .= &#39;&lt;hr&gt;&#39;;
  }
  $html .= &#39;&lt;/ul&gt;&#39;;
} else {
  echo $html .= &#39;予期しないエラーが発生しました。&#39;;
}</code></pre></div>



<p class="is-style-icon_pen">ハイライト行のimgタグ内のsrc属性の中を修正しました。</p>



<p class="is-style-big_icon_check">楽天APIで取得できる画像URLのサイズは、URL内にある「_ex=128×128」の部分で指定されています。<br>そのため、<code>str_replace()</code>関数で<strong><span class="swl-marker mark_yellow">「数値×数値」のように置換することでサイズ調整が可能</span></strong>です。</p>


<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4374558503914683"
     crossorigin="anonymous"></script>
<!-- ディスプレイ【横長】 -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-4374558503914683"
     data-ad-slot="9744298852"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">まとめ</h2>



<p>いかがだったでしょうか。</p>



<p>この記事では</p>



<ul class="wp-block-list is-style-check_list -list-under-dashed">
<li>APIとは何か？</li>



<li>楽天APIをPHPで使用する方法</li>
</ul>



<p>について解説をしてきました。</p>



<p>楽天APIが使用できれば商品検索ページを実装する以外にも、ライバル店の商品情報を分析するのにも役立ちます。</p>



<p>また、世の中には、楽天API以外に数多くのAPIが存在します。</p>



<p>APIへの理解が深まれば、それらを駆使して便利なWebアプリを効率よく開発することができます。</p>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="gray"><div class="c-balloon__icon -circle"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/07/キリッ-150x150.jpg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">ケケンタ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>この記事が少しでもお役に立ったなら何よりです！</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<p>このブログではPHPやWordPress、Web制作に関する情報を発信しています。</p>



<p>ご興味のある方はほかの記事もご覧いただけるとうれしいです。</p>



<p class="is-style-bg_stripe">【公式ドキュメント】楽天Developers 楽天商品検索API 詳細<br><a href="https://webservice.rakuten.co.jp/documentation/ichiba-item-search">https://webservice.rakuten.co.jp/documentation/ichiba-item-search</a></p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type2" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/eye-catch__composer-how-to__9871-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://kekenta-it-blog.com/composer-how-to/">【初心者向け】Composerの使い方を丁寧に解説！【PHP】</a>
						<span class="p-blogCard__excerpt">Composerってよく見かけるけど、イマイチ使い方がわからないな…… 今回はこうしたお悩みをお持ちの方へ向けて PHPのWebアプリ開発にComposerを導入してパッケージライブ&#8230;</span>					</div>
				</div>
			</div>
		</div>

<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type2" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2023/11/eye-catch__board-app-php__2739-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://kekenta-it-blog.com/board-app-php/">掲示板アプリの作り方｜プログラミング初心者向け【PHP】</a>
						<span class="p-blogCard__excerpt">この記事ではPHPによる 掲示板アプリの作り方 をご紹介します。 掲示板アプリを作成するためには、PHPの基本文法をはじめ、データベース操作（いわゆるCRUD）やHTTPリク&#8230;</span>					</div>
				</div>
			</div>
		</div>

<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type2" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2024/08/eye-catch__php-scraping-use-package__9759-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://kekenta-it-blog.com/php-scraping-use-package/">【PHP】スクレイピングする方法｜データベース保存のソースコードあり</a>
						<span class="p-blogCard__excerpt">PHPでスクレイピングしてみたいんだけど、やり方がわからない…… このようなお悩みをお持ちの方に向けて、この記事では PHPでスクレイピングする方法 を解説します。  こ&#8230;</span>					</div>
				</div>
			</div>
		</div>

<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type2" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://kekenta-it-blog.com/wp-content/uploads/2024/07/eye-catch__php-login-app__9392-300x169.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://kekenta-it-blog.com/php-login-app/">【PHP】ログイン機能の仕組み・ソースコード解説｜ハッシュ値とは？</a>
						<span class="p-blogCard__excerpt">PHPでログイン機能を実装してみたいけど、いざ作ろうとすると何をどうしていいのか分からないな…… この記事ではPHPでログイン機能を実装する方法を解説します。  この記&#8230;</span>					</div>
				</div>
			</div>
		</div>]]></content:encoded>
					
					<wfw:commentRss>https://kekenta-it-blog.com/php-rakuten-api/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
