1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Next.jsとClaude APIで作れる便利ツール3選

1
Last updated at Posted at 2026-05-04

はじめに

Next.jsは、Reactを使用してサーバーサイドレンダリング(SSR)が可能なフレームワークです。Claude APIを組み合わせて、さまざまな便利ツールを作成することができます。本記事では、Next.jsとClaude APIで作れる便利ツールを3選して紹介します。

1. 自動テキスト要約ツール

Claude APIのテキスト要約機能を利用して、文章を自動で要約するツールを作成できます。Next.jsで作成したページにテキストエリアを設置し、ユーザーが入力した文章をClaude APIに送信して要約結果を取得します。

import { useState } from 'react';
import axios from 'axios';

const TextSummarizer = () => {
  const [text, setText] = useState('');
  const [summary, setSummary] = useState('');

  const handleSummarize = async () => {
    const response = await axios.post('https://api.claude.ai/summarize', {
      text: text,
    });
    setSummary(response.data.summary);
  };

  return (
    <div>
      <textarea value={text} onChange={(e) => setText(e.target.value)} />
      <button onClick={handleSummarize}>要約</button>
      <p>{summary}</p>
    </div>
  );
};

2. 画像からテキストを読み取りツール

Claude APIのOCR(光学文字認識)機能を利用して、画像からテキストを読み取るツールを作成できます。Next.jsで作成したページに画像アップロード機能を設置し、ユーザーがアップロードした画像をClaude APIに送信してテキストを抽出します。

import { useState } from 'react';
import axios from 'axios';

const ImageReader = () => {
  const [image, setImage] = useState(null);
  const [text, setText] = useState('');

  const handleUpload = async (e) => {
    const file = e.target.files[0];
    const formData = new FormData();
    formData.append('image', file);
    const response = await axios.post('https://api.claude.ai/ocr', formData);
    setText(response.data.text);
  };

  return (
    <div>
      <input type="file" onChange={handleUpload} />
      <p>{text}</p>
    </div>
  );
};

3. 自動翻訳ツール

Claude APIの翻訳機能を利用して、文章を自動で翻訳するツールを作成できます。Next.jsで作成したページにテキストエリアを設置し、ユーザーが入力した文章をClaude APIに送信して翻訳結果を取得します。

import { useState } from 'react';
import axios from 'axios';

const Translator = () => {
  const [text, setText] = useState('');
  const [translation, setTranslation] = useState('');

  const handleTranslate = async () => {
    const response = await axios.post('https://api.claude.ai/translate', {
      text: text,
    });
    setTranslation(response.data.translation);
  };

  return (
    <div>
      <textarea value={text} onChange={(e) => setText(e.target.value)} />
      <button onClick={handleTranslate}>翻訳</button>
      <p>{translation}</p>
    </div>
  );
};

まとめ

Next.jsとClaude APIを組み合わせて、さまざまな便利ツールを作成することができます。本記事で紹介した3つのツールは、初心者でも簡単に作成できます。詳しい手順はこちら → https://felixstudio0.gumroad.com

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?