# URL API

[`URLService`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-URLService.html) enables you to find, load and update external URLs used in RichText and URL fields.

To view a list of all URLs, use [`URLService::findUrls`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-URLService.html#method_findUrls)

`URLService::findUrls` takes as argument a [`URLQuery`](https://doc.ibexa.co/en/latest/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-URL-URLQuery.html), in which you need to specify:

- query filter, for example, Section
- Sort Clauses for URL queries
- offset for search hits, used for paging the results
- query limit. If value is `0`, search query doesn't return any search hits

```
// ...
use Ibexa\Contracts\Core\Repository\URLService;
use Ibexa\Contracts\Core\Repository\Values\URL\Query\Criterion;
use Ibexa\Contracts\Core\Repository\Values\URL\Query\SortClause;
use Ibexa\Contracts\Core\Repository\Values\URL\URLQuery;

// ...
        $query = new URLQuery();

        $query->filter = new Criterion\LogicalAnd(
            [
                new Criterion\SectionIdentifier(['standard']),
                new Criterion\Validity(true),
            ]
        );
        $query->sortClauses = [
            new SortClause\URL(SortClause::SORT_DESC),
        ];
        $query->offset = 0;
        $query->limit = 25;

        $results = $this->urlService->findUrls($query);
```

## URL search reference

For the reference of Search Criteria and Sort Clauses you can use in URL search, see [URL Search Criteria](https://doc.ibexa.co/en/latest/search/url_search_reference/url_search_criteria/index.md) and [URL Sort Clauses](https://doc.ibexa.co/en/latest/search/url_search_reference/url_search_sort_clauses/index.md).
