{"uid":"cap_jh1HyK8cY6MoCR7zkwIG2","slug":"one-engine-array-flatten-top-10-2690e8ef","name":"ONE Engine Array Flatten (Top 10)","description":"Low-cost pay-per-call utility APIs for autonomous agents using x402 on Base.","url":"https://one-search.one-engine.workers.dev/v3/array/flatten/t10?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["values"],"properties":{"size":{"type":"integer"},"other":{"type":"array","description":"Optional comparison array"},"offset":{"type":"integer"},"values":{"type":"array","description":"JSON array with at most 1000 items"}}},"responseSchema":{"type":"object","additionalProperties":true},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.03","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.03/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_oFBtoh9HmQJTEQMuXyf9Y","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.03","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Flattens a nested JSON array and returns the top 10 results, with optional comparison array and offset support.","exampleAgentPrompt":"Can you flatten this nested JSON array for me and give me the top 10 items? Here's the data: [[1, [2, 3]], [4, [5, [6]]], 7, 8, 9, 10, 11, 12].","exampleUseCases":[{"title":"Flatten nested search results","prompt":"I have a nested array of search result groups from different sources — can you flatten them all into a single list and give me the top 10 entries? Here's the data: [[\"result1\",\"result2\"],[\"result3\",[\"result4\",\"result5\"]],\"result6\"]."},{"title":"Paginate through flattened data","prompt":"Flatten this nested array and return items 11 through 20 — so use an offset of 10 and size 10. The array is: [[\"a\",\"b\"],[\"c\",[\"d\",\"e\"]],[\"f\",\"g\",\"h\"],[\"i\",\"j\"],[\"k\",[\"l\",\"m\"]],[\"n\",\"o\",\"p\"]]."},{"title":"Compare flattened array against reference","prompt":"Flatten this nested array and compare the top 10 flattened results against my reference list [\"apple\",\"banana\",\"cherry\"]. Input array: [[\"apple\",[\"mango\",\"banana\"]],[\"cherry\",[\"grape\",\"kiwi\"]],\"melon\"]."}],"resultDescription":"Returns a JSON object containing the flattened version of the input nested array, limited to the top 10 items (with optional offset for pagination), and optionally compared against a provided reference array.","failureModes":["Input array exceeds 1000 items — request rejected","Malformed or non-array 'values' field — validation error","Payment not provided or insufficient USDC via x402 — 402 response","Offset beyond array length returns empty or partial results","Deeply recursive structures may hit processing limits"],"whenToPreferThis":"Use this endpoint when an AI agent needs a quick, cheap, pay-per-call utility to flatten nested JSON arrays and retrieve the top 10 results, especially when operating on Base with x402 micropayments. Prefer this over rolling custom code when the agent needs a reliable, stateless transformation without infrastructure overhead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:43:47.623Z","isFirstParty":false,"canonicalSlug":"one-engine-array-flatten-top-10-2690e8ef"}