Find, Replace, and Audit Spreadsheet Content: A Developer’s Guide to the Aspose.Cells Cloud Search API
No more downloading huge Excel files just to look for a value. Search text, replace content, and detect broken links — all through REST calls that run entirely in the cloud.
Searching inside spreadsheets is a deceptively common development task:
- Data teams need to find every cell containing a legacy product code before a migration;
- Compliance officers need to redact or replace a client name across hundreds of workbooks;
- QA engineers need to audit spreadsheets for broken hyperlinks before publishing reports;
- Support teams need to locate specific error codes scattered across log exports.
Doing this with desktop Excel automation is slow, fragile, and doesn’t scale. Aspose.Cells Cloud turns all of it into simple REST calls — search, replace, and audit spreadsheets without ever downloading the file. This post walks through the full SearchController API surface (src/Aspose.Cells.Cloud.MicroService/Controllers/SearchController.cs), with runnable examples in cURL, C# (.NET), and Python.
1. What Does the Search Controller Do?
SearchController is the dedicated controller for content discovery, replacement, and link auditing. It exposes a rich set of endpoints across three functional areas:
| # | Area | Endpoints | Description |
|---|---|---|---|
| 1 | Text Search | 6 endpoints | Search text across workbooks, worksheets, or specific cell ranges — both local (uploaded) and remote (cloud storage) files |
| 2 | Text Replace | 4 endpoints | Replace text with the same scoping options — local and remote |
| 3 | Broken Link Detection | 4 endpoints | Scan for dead hyperlinks and missing external references |
All routes use the
v4.0API prefix. The full base URL ishttps://api.aspose.cloud/v4.0/cells/....
Key Design Pattern: Local vs. Remote
Almost every operation comes in two flavors:
- Local (Online) — you upload the file in the request body, the server processes it and returns the result. Nothing is stored. Route prefix:
/v4.0/cells/...(no filename in URL). - Remote (Cloud) — the file already lives in cloud storage. You reference it by name (and optional folder). Route prefix:
/v4.0/cells/{name}/....
This gives you maximum flexibility: ad-hoc analysis on local files, or automated pipelines on cloud-stored data.
2. Full API Reference Table
| Endpoint | Method | Scope | Description |
|---|---|---|---|
/search/content/all-textitems |
PUT | Local workbook | Extract all text items from an uploaded spreadsheet |
/{name}/search/content/all-textitems |
GET | Remote workbook | Extract all text items from a cloud-stored spreadsheet |
/search/content |
PUT | Local workbook | Search for specific text in an uploaded spreadsheet |
/{name}/search/content |
GET | Remote workbook | Search for specific text in a cloud-stored spreadsheet |
/{name}/worksheets/{worksheet}/search/content |
GET | Remote worksheet | Search within a specific worksheet |
/{name}/worksheets/{worksheet}/ranges/{cellArea}/search/content |
GET | Remote range | Search within a specific cell range (e.g., A1:C10) |
/replace/content |
PUT | Local workbook | Replace text in an uploaded spreadsheet (returns modified file) |
/{name}/replace/content |
PUT | Remote workbook | Replace text in a cloud-stored spreadsheet (modifies in place) |
/{name}/worksheets/{worksheet}/replace/content |
PUT | Remote worksheet | Replace text within a specific worksheet |
/{name}/worksheets/{worksheet}/ranges/{cellArea}/replace/content |
PUT | Remote range | Replace text within a specific cell range |
/search/broken-links |
PUT | Local workbook | Find broken hyperlinks in an uploaded spreadsheet |
/{name}/search/broken-links |
GET | Remote workbook | Find broken hyperlinks in a cloud-stored spreadsheet |
/{name}/worksheets/{worksheet}/search/broken-links |
GET | Remote worksheet | Find broken links within a specific worksheet |
/{name}/worksheets/{worksheet}/ranges/{cellArea}/search/broken-links |
GET | Remote range | Find broken links within a specific cell range |
3. Prerequisites
- Register at Aspose Cloud Dashboard and get your
Client ID+Client Secret. - Install the SDK (optional):
<!-- .NET -->
<PackageReference Include="Aspose.Cells-Cloud" Version="25.x" />
# Python
pip install asposecellscloud
4. Quick Start: Search for Text in a Local Spreadsheet
The simplest use case: upload a file and search for a string.
cURL
# 1) Get token
curl -X POST "https://api.aspose.cloud/connect/token" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
# 2) Search for "revenue" in an uploaded file
curl -X PUT "https://api.aspose.cloud/v4.0/cells/search/content?searchText=revenue&ignoringCase=true" \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: multipart/form-data" \
-F "file=@data.xlsx"
Response:
{
"Code": "OK",
"TextItems": [
{ "SheetName": "Q1", "CellName": "B12", "Value": "Total Revenue" },
{ "SheetName": "Q1", "CellName": "B25", "Value": "Net Revenue" },
{ "SheetName": "Summary", "CellName": "C3", "Value": "Revenue Growth" }
]
}
C# (.NET SDK)
var cellsApi = new CellsApi(clientId, clientSecret);
using var stream = File.OpenRead("data.xlsx");
var result = await cellsApi.SearchSpreadsheetContent(
workbook: stream,
searchText: "revenue",
ignoringCase: true
);
foreach (var item in result.TextItems)
{
Console.WriteLine($"{item.SheetName}!{item.CellName}: {item.Value}");
}
Python
api = SearchApi(client_id, client_secret)
with open("data.xlsx", "rb") as f:
result = api.search_spreadsheet_content(
workbook=f,
search_text="revenue",
ignoring_case=True
)
for item in result.text_items:
print(f"{item.sheet_name}!{item.cell_name}: {item.value}")
5. Use Case Walkthrough: Replace a Client Name Across a Workbook
A compliance team needs to replace “Acme Corp” with “[REDACTED]” across all sheets of a cloud-stored workbook.
cURL
curl -X PUT "https://api.aspose.cloud/v4.0/cells/financial-report.xlsx/replace/content?searchText=Acme%20Corp&replaceText=%5BREDACTED%5D" \
-H "Authorization: Bearer TOKEN"
That’s it. The file in cloud storage is updated in place. The API returns:
{ "Code": "OK" }
Scope It Down
If you only want to redact within the “Clients” worksheet:
curl -X PUT "https://api.aspose.cloud/v4.0/cells/financial-report.xlsx/worksheets/Clients/replace/content?searchText=Acme%20Corp&replaceText=%5BREDACTED%5D" \
-H "Authorization: Bearer TOKEN"
Or just within a specific range (A1:Z100):
curl -X PUT "https://api.aspose.cloud/v4.0/cells/financial-report.xlsx/worksheets/Clients/ranges/A1:Z100/replace/content?searchText=Acme%20Corp&replaceText=%5BREDACTED%5D" \
-H "Authorization: Bearer TOKEN"
6. Quick Audit: Find Broken Links
Before publishing a report, you want to make sure no hyperlinks are dead.
cURL
curl -X GET "https://api.aspose.cloud/v4.0/cells/annual-report.xlsx/search/broken-links" \
-H "Authorization: Bearer TOKEN"
Response:
{
"Code": "OK",
"BrokenLinks": [
{ "SheetName": "References", "CellName": "D15", "Url": "https://old-server/report-2022.xlsx" },
{ "SheetName": "Appendix", "CellName": "A3", "Url": "file:///\\deprecated\share\docs\policy.doc" }
]
}
7. Extract All Text Items
Sometimes you don’t know what you’re looking for — you just want a full inventory of all text content in a spreadsheet.
curl -X PUT "https://api.aspose.cloud/v4.0/cells/search/content/all-textitems" \
-H "Authorization: Bearer TOKEN" \
-F "file=@mystery-spreadsheet.xlsx"
This returns every text item with its sheet name and cell address — ideal for building search indexes, performing content audits, or feeding into AI/ML pipelines.
8. Key Benefits Summary
- No file downloads — search and replace run entirely in the cloud.
- Granular scoping — whole workbook, single worksheet, or specific cell range.
- Case-insensitive by default — with
ignoringCase=falsefor exact matching. - Broken link detection — audit hyperlinks before publishing.
- Local and remote modes — ad-hoc uploads or automated cloud pipelines.
- Returns structured data — JSON responses with sheet name, cell address, and value.