{"mode":"words","changes":{"added_blocks":1,"removed_blocks":0,"equal":2},"diff":[{"value":"hello ","added":false,"removed":false},{"value":"brave ","added":true,"removed":false},{"value":"world","added":false,"removed":false}],"unified_patch":"===================================================================\n--- a\n+++ b\n@@ -1,1 +1,1 @@\n-hello world\n\\ No newline at end of file\n+hello brave world\n\\ No newline at end of file\n"}
curl --location --request POST 'https://zylalabs.com/api/13164/text+difference+and+patch+api/26710/compare+two+texts' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"a": "hello world", "b": "hello brave world", "mode": "words"}'
Después de registrarte, a cada desarrollador se le asigna una clave de acceso a la API personal, una combinación única de letras y dígitos proporcionada para acceder a nuestro endpoint de la API. Para autenticarte con el Text Difference and Patch API simplemente incluye tu token de portador en el encabezado de Autorización.
| Encabezado | Descripción |
|---|---|
Autorización
|
Requerido
Debería ser Bearer access_key. Consulta "Tu Clave de Acceso a la API" arriba cuando estés suscrito.
|
Sin compromiso a largo plazo. Mejora, reduce o cancela en cualquier momento. La Prueba Gratuita incluye hasta 50 solicitudes.
(Ahorra 2 meses pagando anualmente 🎉)
Empresas líderes confían en nosotros
See exactly what changed between two texts. One call compares them by lines, words or characters and returns both a structured, machine readable difference and a unified patch string, the same format version control tools use.
Useful for tracking revisions of contracts, articles and documentation, audit logs that must show exactly what changed, review robots for configuration files, and detecting content changes in monitored pages.
The Compare Two Texts endpoint returns a structured difference between two texts, including parts flagged as added or removed, a summary count of changes, and a unified patch string. This allows users to see exactly what has changed in a clear format.
Key fields in the response include "mode" (indicating the granularity), "changes" (with counts of added and removed blocks), "diff" (showing individual text segments with flags), and "unified_patch" (the formatted patch string).
The response data is organized into a JSON structure. It includes a summary of changes, a detailed list of differences with flags for added or removed text, and a unified patch string formatted for easy application or storage.
Los usuarios pueden especificar el parámetro "modo" para elegir la granularidad de comparación: línea, palabra o carácter. Esto permite comparaciones personalizadas según el nivel de detalle requerido
Los casos de uso típicos incluyen rastrear revisiones en contratos revisar cambios en artículos mantener registros de auditoría para documentación y monitorear cambios de contenido en páginas web asegurando un seguimiento preciso de los cambios
Los usuarios pueden utilizar los datos devueltos analizando el "diff" para cambios específicos aplicando el "unified_patch" para actualizar documentos o generando informes basados en los recuentos resumen de bloques de texto añadidos y eliminados
Data accuracy is maintained by performing in-memory comparisons without storing the texts, ensuring that only the current state of the texts is analyzed, thus providing reliable and immediate results.
Users can expect a consistent structure in the response, with "added" and "removed" flags clearly indicating changes, and a unified patch that follows a standard format similar to version control systems, making it easy to interpret.