勉強したことのメモ

Webエンジニア / プログラマが勉強したことのメモ。

Google Chart APIを用いてQRコードを生成する方法

   2024/04/18  Google

jqueryとかpearのライブラリとか使わずに、簡単にQRコードを生成したかった。調べてみるとgoogleのapiで簡単に作れた。

 

ソースコード

<img src="https://chart.apis.google.com/chart?chs=【サイズ】x【サイズ】&cht=qr&chl=【ここにURL】>

当方のサイトの( https://taitan916.info/blog/ )場合だと以下になる。

<img src="https://chart.apis.google.com/chart?chs=300x300&cht=qr&chl=https://taitan916.info/blog/">

 

リファレンス

https://developers.google.com/chart/infographics/docs/qr_codes?hl=ja

 

その他の方法

API等の外部サービスを経由してQRコードを作成

PHP Qr Codeライブラリを使用してQRコードを生成する方法

 - Google