Text
Longest common subsequence API
Computes the longest common subsequence (non-contiguous) of two strings, returning its length, the reconstructed sequence, and a similarity ratio. Answers 'what is the longest ordered set of shared characters?', 'how aligned are these sequences?'.
Price$0.02per request
MethodPOST
Route/v1/text/lcs
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
textlcssubsequencediffalignmentsimilarityfuzzystring-distance
API URL
Integration docshttps://x402.hexl.dev/v1/text/lcsExample request
{
"a": "ABCBDAB",
"b": "BDCAB"
}Example response
{
"length": 4,
"subsequence": "BCAB",
"similarity": 0.571429
}Input schema
{
"type": "object",
"required": [
"a",
"b"
],
"properties": {
"a": {
"type": "string",
"examples": [
"ABCBDAB"
]
},
"b": {
"type": "string",
"examples": [
"BDCAB"
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}