<commit_before>.. _search:

======
Search
======

This API allows search for apps by various properties.

.. _search-api:

Search
======

.. http:get:: /api/v1/apps/search/

    **Request**

    :param optional q: The query string to search for.
    :type q: string
    :param optional cat: The category slug or ID to filter by. Use the
        category API to find the ids of the categories.
    :type cat: int|string
    :param optional device: Filters by supported device. One of 'desktop',
        'mobile', 'tablet', or 'firefoxos'.
    :type device: string
    :param optional premium_types: Filters by whether the app is free or
        premium or has in-app purchasing. Any of 'free', 'free-inapp',
        'premium', 'premium-inapp', or 'other'.
    :type premium_types: string
    :param optional type: Filters by type of add-on. One of 'app' or
        'theme'.
    :type type: string
    :param optional app_type: Filters by type of web app. One of 'hosted' or
        'packaged'.
    :type app_type: string
    :param optional manifest_url: Filters by manifest URL. Requires an
        exact match and should only return a single result if a match is
        found.
    :type manifest_url: string
    :param optional sort: The fields to sort by. One or more of 'downloads', 'rating',
        'price', 'created', separated by commas. Sorts by relevance by default.
    :type sort: string

    The following parameters requires an OAuth token by a user with App
    Reviewer privileges:

    :param optional status: Filters by app status. Default is 'public'. One
        of 'pending', 'public', 'disabled', 'rejected', 'waiting'.
    :type status: string

    **Response**

    :param meta: :ref:`meta-response-label`.
    :type meta: object
    :param objects: A :ref:`listing <objects-response-label>` of
        :ref:`apps <app-response-label>`, with the following additional
        fields:
    :type objects: array


    .. code-block:: json

        {
            "absolute_url": http://server.local/app/my-app/",
        }

    :status 200: successfully completed.
    :status 401: if attempting to filter by status, you do not have that role.

Featured App Listing
====================

.. http:get::  /api/v1/fireplace/search/featured/

    **Request**

    Accepts the same parameters and returns the same objects as the<commit_msg>Add documentation for new is_privileged param in the search API<commit_after>.. _search:

======
Search
======

This API allows search for apps by various properties.

.. _search-api:

Search
======

.. http:get:: /api/v1/apps/search/

    **Request**

    :param optional q: The query string to search for.
    :type q: string
    :param optional cat: The category slug or ID to filter by. Use the
        category API to find the ids of the categories.
    :type cat: int|string
    :param optional device: Filters by supported device. One of 'desktop',
        'mobile', 'tablet', or 'firefoxos'.
    :type device: string
    :param optional premium_types: Filters by whether the app is free or
        premium or has in-app purchasing. Any of 'free', 'free-inapp',
        'premium', 'premium-inapp', or 'other'.
    :type premium_types: string
    :param optional type: Filters by type of add-on. One of 'app' or
        'theme'.
    :type type: string
    :param optional app_type: Filters by type of web app. One of 'hosted' or
        'packaged'.
    :type app_type: string
    :param optional manifest_url: Filters by manifest URL. Requires an
        exact match and should only return a single result if a match is
        found.
    :type manifest_url: string
    :param optional sort: The fields to sort by. One or more of 'downloads', 'rating',
        'price', 'created', separated by commas. Sorts by relevance by default.
    :type sort: string

    The following parameters requires an OAuth token by a user with App
    Reviewer privileges:

    :param optional status: Filters by app status. Default is 'public'. One
        of 'pending', 'public', 'disabled', 'rejected', 'waiting'.
    :type status: string
    :param optional is_privileged: Filters by whether the latest version of the
        app is privileged or not.
    :type is_privileged: boolean

    **Response**

    :param meta: :ref:`meta-response-label`.
    :type meta: object
    :param objects: A :ref:`listing <objects-response-label>` of
        :ref:`apps <app-response-label>`, with the following additional
        fields:
    :type objects: array


    .. code-block:: json

        {
            "absolute_url": http://server.local/app/my-app/",
        }

    :status 200: successfully completed.
    :status 401: if attempting to filter by status, you do not have that role.

Featured App Listing
====================

.. http:get::  /api/v1/fireplace/search/featured/

    **Request**

    Accepts the same parameters and returns the same objects as the
{'fraction_non_alphanumeric': 0.10866462793068297, 'fraction_numerical': 0.0032619775739041795, 'mean_word_length': 2.8149300155520995, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1848681', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1366, 'n_words': 587}