0

I want to get product all the detail in Search Rest Api response but Magento default is returning only id and custom_attributes attributes.

Api :- `http://127.0.0.1/magento/rest/V1/search?searchCriteria[requestName]=quick_search_container&searchCriteria[filterGroups][0][filters][0][field]=search_term&searchCriteria[filterGroups][0][filters][0][value]=MS09

Response :-

{
"items": [
    {
        "id": 484,
        "custom_attributes": [
            {
                "attribute_code": "score",
                "value": "607.6608886718750000"
            }
        ]
    }
],
"aggregations": {
    "buckets": [
        {
            "name": "category_bucket",
            "values": [
                {
                    "value": "12",
                    "metrics": [
                        "12",
                        "1"
                    ]
                },
                {
                    "value": "16",
                    "metrics": [
                        "16",
                        "1"
                    ]
                }
            ]
        }
    ],
    "bucket_names": [
        "category_bucket"
    ]
},
"search_criteria": {
    "request_name": "quick_search_container",
    "filter_groups": [
        {
            "filters": [
                {
                    "field": "search_term",
                    "value": "MS09",
                    "condition_type": "eq"
                }
            ]
        }
    ]
},
"total_count": 1

}

1 Answer 1

0

Search endpoint is public so the details are not included. For all product details you should use the products endpoint. You need an admin token in your header to get the information. If MS09 is your sku, the URL would be http://127.0.0.1/magento/rest/V1/products/MS09

See docs here for reference https://devdocs.magento.com/guides/v2.4/rest/search-endpoint.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.