メインコンテンツへスキップ

行を抽出する Excel

PDF4me 行を抽出する は REST ワークシートの行を読み取るエンドポイント Excel ワークブックを作成し、構造化された形式で返します。 JSON。 POST .xlsx を Base64 に office/ApiV2Excel/ExcelExtractRowsアクションオブジェクトでワークシートと行範囲をスコープし、 rowData 配列です。ファイルではなくデータを返します。 document nullを返します。

このエンドポイントの機能

ワークシートのスライスを JSON 配列: 各行は 1 つのオブジェクトになります 行データデータベース挿入の準備が整い、 API 呼び出し、またはレポート。これは、Add Rows および Update Rows の読み取り専用対応物であり、 API-側でのエクスポートに相当するもの Excel データを開くことなく Excel変更されたファイルは生成されません。

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

認証 API リクエスト​

毎 PDF4me REST 電話にはあなたの API キー Authorization ヘッダーを基本認証として設定します。開発者ダッシュボードからキーを取得またはローテーションしてください。

終点​

POSToffice/ApiV2Excel/ExcelExtractRows

見逃してはならない重要な事実​

rowDataは出力であり、ファイルフィールドはnullです。
このエンドポイントはデータを返すものであり、変更されたワークブックを返すものではありません。 書類 そして fileName 設計上 null を返します。 Base64 そこにあるファイルは壊れます。
エンジンは行を0から数えます
0行目は Excel 行 1、-1 は最後のデータ行を意味し、同じ意味です n8n このエンジンの「行の抽出」アクションに関するドキュメントです。最も多いサポートに関する質問は、範囲のずれに関するものです。
読み取り専用:ワークブックは変更されません
抽出はファイルを解析し、行をシリアル化します JSON何も書き戻されないため、本番環境のワークブックやアーカイブに対しても安全に実行できます。

HTTP 設定​

方法: POST
URL: https://api.pdf4me.com/office/ApiV2Excel/ExcelExtractRows
コンテンツタイプ: アプリケーション/json
Authorization: 基本 <あなたの PDF4me API キー>

回答は JSON: チェック success フラグを、次に反復します 行データ 配列。デコードするファイルがありません。

「Extract Rows」は他の機能とどう違うのですか? Excel 行の操作?​

行ファミリーには、書き込み、上書き、読み取りが含まれます。ワークブックに対してどのような処理を実行するかに応じて選択してください。

行動と振る舞いワークブックにどのような影響を与えるか返ってくるもの
行を抽出する(このエンドポイント)何もなし、読み取り専用A rowData JSON 配列、1行につき1つのオブジェクト
行を追加する新しい行を追加または挿入します変更されたワークブックとして Base64
行を更新する既存の行の値を上書きします変更されたワークブックとして Base64
行を削除する行を削除します変更されたワークブックとして Base64

API ボディフィールド​

パラメータ必須その機能例
documentRequiredSource file. `Name` must end in `.xlsx`, `.xls` or `.xlsm` (a `.csv` for `ExcelParseCsv`).{ "Name": "data.xlsx" }
document.NameRequiredFile name including its extension. Type: string.{ "Name": "data.xlsx" }
docContentRequiredThe source file, base64-encoded. Type: string.UEsDBBQABgAIAAAA...
isAsyncOptionalProcess the request in the background. The call returns `202 Accepted`; poll the `Location` URL (`GetActionStatus`) for the result. Type: boolean.
extractRowsToExcelActionRequiredObject carrying this operation's settings. Its fields are the extractRowsToExcelAction rows below.{}
extractRowsToExcelAction.worksheetNameOptionalThe sheet to read. Defaults to the first sheet. Type: string.
extractRowsToExcelAction.hasHeaderRowOptionalUse the first row as the property names. Type: boolean.
extractRowsToExcelAction.firstRowOptional0-based first row to read. Type: integer.
extractRowsToExcelAction.lastRowOptional0-based last row to read. `-1` is the last row with data. Type: integer.
extractRowsToExcelAction.firstColumnOptional0-based first column to read. Type: integer.
extractRowsToExcelAction.lastColumnOptional0-based last column to read. `-1` is the last column with data. Type: integer.
extractRowsToExcelAction.excludeEmptyRowsOptionalSkip empty rows. Type: boolean.
extractRowsToExcelAction.excludeHiddenRowsOptionalSkip hidden rows. Type: boolean.
extractRowsToExcelAction.excludeHiddenColumnsOptionalSkip hidden columns. Type: boolean.
extractRowsToExcelAction.exportValuesAsTextOptionalReturn numbers as text. Type: boolean.
extractRowsToExcelAction.exportEmptyCellsOptionalInclude empty cells as `""`. Type: boolean.
extractRowsToExcelAction.cultureOptionalCulture used to format values. Type: string.

サンプルペイロード​

デフォルトのワークシートを読み込む​

{
"document": { "Name": "data.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"extractRowsToExcelAction": {}
}

文化を意識した価値観が記載されたワークシートを読んでください。​

{
"document": { "Name": "sales.xlsx" },
"docContent": "UEsDBBQABgAIAAAA...",
"extractRowsToExcelAction": {
"worksheetName": "Q3",
"cultureName": "en-US"
}
}

郵便配達員の集荷に関するヒント​

Headers
Content-Type: application/json + Authorization: Basic <apiKey>.
Body
raw JSON. extractRowsToExcelAction may be an empty object {}; worksheet targeting and ranges are optional narrowing.
Response
Plain JSON. Assert on rowData, not on document: the file fields are null for this endpoint by design.
Ranges
The engine counts rows 0-based and treats -1 as "to the last data row". Test with a small explicit range first.

curlの例​

curl -X POST https://api.pdf4me.com/office/ApiV2Excel/ExcelExtractRows \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_API_KEY" \
-d '{
"document": { "Name": "data.xlsx" },
"docContent": "'"$(base64 -w 0 data.xlsx)"'",
"extractRowsToExcelAction": { "worksheetName": "Sheet1" }
}' \
--output response.json

何が API 戻る?​

A JSON ペイロードが rowData 配列。

分野タイプ内容物
rowDataArray of objectsThe primary output. Each entry is one extracted row as a JSON object, with column names or indexes as keys.
successBooleantrue when extraction succeeded. Check this before iterating rowData.
documentnullNull for this endpoint: no modified file is produced. Present only because the office family shares one response shape.
fileNamenullNull for this endpoint, for the same reason as document.
errorMessageStringPopulated when success is false: a missing worksheet, invalid Base64, or a corrupted workbook.
{
"document": null,
"fileName": null,
"success": true,
"errorMessage": null,
"rowData": [
{ "ColumnA": "value1", "ColumnB": "value2" },
{ "ColumnA": "value3", "ColumnB": "value4" }
]
}

コードサンプル​

Excel オフィスエンドポイントはまだパーlanguage サンプルフォルダ。サンプルリポジトリには、すべてのサンプルで使用されるリクエストパターンが含まれています。 PDF4me エンドポイントファミリー:

よくある質問​

Why are document and fileName null in the response?+
Because Extract Rows returns data, not a modified workbook. The primary output is the rowData array of row objects; the file-oriented fields exist in the shared response shape but stay null for this endpoint.
Are row indexes 0-based or 1-based?+
The extraction engine behind this action counts rows and columns 0-based, so row 0 is Excel row 1, and -1 means read to the last data row or column. If your range seems off by one, this is why.
Can I pipe the output into a database or another API?+
Yes, that is the point of the endpoint. rowData is plain JSON: each array entry is one row as an object, ready for an INSERT statement, an HTTP POST, or any downstream transformation.
What happens if I send an empty action object?+
The action still runs: the API reads the default worksheet and returns its rows. Add worksheetName or a row range only when you need to narrow the extraction.
Does this endpoint modify my Excel file?+
No. It is read-only. The source workbook is parsed, the rows are serialized to JSON, and no modified file is produced or returned.
Can I read a password-protected workbook?+
No. Protection blocks parsing. Chain the Unlock Excel action first with the correct password, then extract from the unlocked copy.
How do I extract whole worksheets instead of rows?+
Use the Extract Worksheets action, which splits worksheets out of the workbook. Extract Rows is for reading row values as JSON; Extract Worksheets is for separating sheets as workbook content.

なぜ抽出するのか Excel 譲渡された API 手動で行う代わりに?​

手動の方法では、ワークブックを開き、範囲を選択し、それをどこかにコピーし、手動で形状を変更する必要があり、これはファイルごと、更新ごとに1回ずつ行われます。 API 1 つの決定論的リクエストと同じ行を読み取り、 JSON いかなるものも language ネイティブに解析し、 Excel サーバーへのインストール。ソースは標準のままなので オフィス営業中 XML ワークブックと読み取り専用の操作であれば、同じ呼び出しをライブファイルに対してスケジュール実行しても安全です。

関連アクション​

他のプラットフォームでも同じタスクを実行​

ヘルプが必要な場合​