Search Article by title Ruby API

Gaurav_Choudhar
New Member
1 0 0
ShopifyAPI::Article.find(:all, params: { title: 'random-blog'})

Search by title doesn't work

ShopifyAPI::Article.find(:all, params: { handle: 'random-blog'})

This works only when exact match

ShopifyAPI::Product.find(:all, params: { title: @query, :limit => 5 })
ShopifyAPI::SmartCollection.find(:all, params: { title: @query, :limit => 5 })

Whereas both of the above APIs work on contains match basis

Please suggest best approach to search article by title contains match basis.

0 Likes
Josh
Shopify Staff
Shopify Staff
1131 82 198

Hey Guarav, 

This isn't a method that is supported by that API endpoint currently. In order to search by title you'd have to fetch all articles and then sort through them after the fact. 

Cheers, 

Josh Wheeler

0 Likes
aldrien
Shopify Partner
12 0 1

Hi Josh, can you please help with the new syntax to filter search by Article's title.
The versions I used are:

gem 'shopify_app', "13.2.0"
gem 'shopify_api', "9.1.0"

0 Likes