{"description":"Searches the Swift Package Index like its search page: package name, GitHub owner/repository, one-line description, star count and package page link. First results page only. Returns an empty list when nothing matches.","effect":"read","id":"swiftpackageindex.com/search-packages","keywords":["swift","swift package index","swiftpackageindex","swiftpm","package","packages","library","libraries","ios","macos","github","spm","dependency","framework"],"output":{"schema":{"properties":{"packages":{"items":{"properties":{"description":{"type":["string","null"]},"name":{"type":"string"},"repository":{"description":"GitHub owner/repository, e.g. 'Alamofire/Alamofire'","type":["string","null"]},"stars":{"type":["integer","null"]},"url":{"type":"string"}},"required":["name","url"],"type":"object"},"type":"array"},"query":{"type":"string"}},"required":["query","packages"],"type":"object"},"value":"{query: params.query, packages: steps.search.packages[?name != `null` && href != `null`].{name: name, repository: identifier || `null`, description: description || `null`, stars: (stars && to_number(replace(split(stars, ' ')[0], ',', ''))) || `null`, url: join('', ['https://swiftpackageindex.com', href])}}"},"params":{"additionalProperties":false,"properties":{"query":{"description":"Package name, keyword or feature, e.g. 'networking', 'markdown', 'charts'","maxLength":100,"minLength":2,"type":"string"}},"required":["query"],"type":"object"},"provenance":{"method":"har","notes":"GET /search?query=<query> answers 200 HTML. The matching packages are li items in ul#package-list: a link to /owner/repo with h4 name, p description, li.identifier and li.stars. The page uses the bare host; the www host redirects to the home page, so the origin is swiftpackageindex.com.","recorded_at":"2026-11-08T16:22:40.000Z","recorded_by":"wield-forge (claude-haiku agent)"},"requires_login":false,"schema":"https://wield.run/schema/recipe/v1.json","site":{"country":"US","id":"swiftpackageindex.com","language":"en","name":"Swift Package Index","origin":"https://swiftpackageindex.com","origins":["https://swiftpackageindex.com"]},"steps":[{"description":"Swift Package Index search page /search?query=…; read-only GET. Packages are li elements of ul#package-list, each a link to the package page with name, identifier, description and stars.","expect":{"assert":"status == `200` && contains(body, 'package-results')","content_type":"html","status":[200]},"extract":{"html_items":{"packages":{"fields":{"description":{"selector":"p"},"href":{"attr":"href","selector":"a"},"identifier":{"selector":"li.identifier small"},"name":{"selector":"h4"},"stars":{"selector":"li.stars small"}},"max":50,"selector":"#package-list > li"}}},"id":"search","request":{"headers":{"Accept":"text/html"},"method":"GET","query":{"query":"{{params.query}}"},"url":"/search"}}],"task":"Search Swift packages","tos":{"notes":"Not reviewed. One search page per call, the same page a visitor loads. The site's terms on automated access were not checked.","reviewed":false},"verify":{"checks":["length(output.packages) > `0`","length(output.packages[?starts_with(url, 'https://swiftpackageindex.com/')]) == length(output.packages)","length(output.packages[?name != `null`]) == length(output.packages)","length(output.packages[?repository != `null`]) > `0`"],"example_params":{"query":"networking"},"max_ms":5000},"version":1}