{"id":25873083,"url":"https://github.com/codeinwp/yourls-api-list-extended","last_synced_at":"2025-03-02T08:29:39.704Z","repository":{"id":257471188,"uuid":"858010177","full_name":"Codeinwp/yourls-api-list-extended","owner":"Codeinwp","description":"YOURLS API List action with sorting, pagination, total count, and field selection.","archived":false,"fork":false,"pushed_at":"2024-10-31T03:49:21.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-08T12:37:57.088Z","etag":null,"topics":["yourls","yourls-api","yourls-extension","yourls-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Codeinwp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-16T06:22:50.000Z","updated_at":"2024-11-06T10:14:02.000Z","dependencies_parsed_at":"2024-09-17T00:49:59.075Z","dependency_job_id":"670bdb4a-d2e8-4f27-8a72-778d55a3068f","html_url":"https://github.com/Codeinwp/yourls-api-list-extended","commit_stats":null,"previous_names":["codeinwp/yourls-api-list-extended"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeinwp%2Fyourls-api-list-extended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeinwp%2Fyourls-api-list-extended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeinwp%2Fyourls-api-list-extended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeinwp%2Fyourls-api-list-extended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Codeinwp","download_url":"https://codeload.github.com/Codeinwp/yourls-api-list-extended/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241481752,"owners_count":19969831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["yourls","yourls-api","yourls-extension","yourls-plugin"],"created_at":"2025-03-02T08:29:39.114Z","updated_at":"2025-03-02T08:29:39.692Z","avatar_url":"https://github.com/Codeinwp.png","language":"PHP","readme":"# YOURLS API Action List Extended\n\n**Plugin Name**: YOURLS API Action List Extended  \n**Version**: 1.0.0  \n**Author**: Hardeep Asrani  \n**Author URI**: [https://themeisle.com](https://themeisle.com)  \n**Plugin URI**: [https://github.com/Codeinwp/yourls-api-list-extended](https://github.com/Codeinwp/yourls-api-list-extended)  \n**Description**: YOURLS API List action with sorting, pagination, total count, and field selection.\n\n## Description\n\nThis plugin extends the YOURLS API by adding a `list` action with advanced capabilities. It allows users to retrieve a list of shortened URLs with options for:\n\n- Sorting by keyword, URL, title, timestamp, IP address, or clicks.\n- Pagination using offset and limit (per page).\n- Custom selection of fields to be returned in the API response.\n- Searching by keyword.\n- Total count of links to assist with pagination.\n\n## Features\n\n- **Sorting**: Sort results by any valid field (`keyword`, `url`, `title`, `timestamp`, `ip`, `clicks`).\n- **Pagination**: Use the `offset` and `perpage` parameters to paginate results.\n- **Field Selection**: Select specific fields to return (e.g., `keyword`, `url`, `clicks`). By default, all fields are returned.\n- **Search**: Search for links by keyword.\n- **Total Count**: Returns the total number of links in the database, useful for pagination.\n\n## Installation\n\n1. Download and extract the plugin.\n2. Upload the plugin folder to your YOURLS `user/plugins/` directory.\n3. Activate the plugin from the YOURLS admin interface.\n4. The plugin will automatically extend the YOURLS API with the new `list` action.\n\n## API Usage\n\n### Base URL\n\nUse the following base URL for API requests:\n\n```\nhttp://\u003cyour-yourls-site\u003e/yourls-api.php\n```\n\n### Required Parameters\n\n- `signature`: Your YOURLS API signature token.\n- `action`: Must be set to `list`.\n- `format`: Optional. Specify `json` for JSON responses (default).\n\n### Optional Parameters\n\n- `sortby`: Field to sort by (`keyword`, `url`, `title`, `timestamp`, `ip`, `clicks`). Default is `timestamp`.\n- `sortorder`: Sort order, either `ASC` (ascending) or `DESC` (descending). Default is `DESC`.\n- `offset`: Number of links to skip (used for pagination). Default is `0`.\n- `perpage`: Number of links to return per page. Default is `50`.\n- `query`: Search query to filter results by keyword.\n- `fields[]`: An array of fields to return (e.g., `fields[]=keyword\u0026fields[]=url`). Default is all fields (`*`).\n\n### Example Request\n\n```\nGET http://\u003cyour-yourls-site\u003e/yourls-api.php?action=list\u0026signature=your_signature\u0026sortby=clicks\u0026sortorder=ASC\u0026offset=0\u0026perpage=10\u0026fields[]=keyword\u0026fields[]=url\n```\n\nThis example retrieves the first 10 results, sorted by clicks in ascending order, and returns only the `keyword` and `url` fields.\n\n### Example Response\n\n```json\n{\n  \"statusCode\": 200,\n  \"message\": \"success\",\n  \"result\": [\n    {\n      \"keyword\": \"example1\",\n      \"url\": \"http://example.com\"\n    },\n    {\n      \"keyword\": \"example2\",\n      \"url\": \"http://example.org\"\n    }\n  ],\n  \"total\": 100,\n  \"offset\": 0,\n  \"perpage\": 10\n}\n```\n\n## Parameters Overview\n\n| Parameter  | Type   | Description                                                                 | Default       |\n|------------|--------|-----------------------------------------------------------------------------|---------------|\n| `sortby`   | string | Field to sort results by (`keyword`, `url`, `title`, `ip`, `timestamp`, `clicks`). | `timestamp`   |\n| `sortorder`| string | Sort order, `ASC` for ascending, `DESC` for descending.                      | `DESC`        |\n| `offset`   | int    | Offset for pagination, number of links to skip.                             | `0`           |\n| `perpage`  | int    | Number of links to return per page.                                          | `50`          |\n| `query`    | string | Search query to filter results by keyword.                                  |               |\n| `fields[]` | array  | Fields to return in the response. Use array format: `fields[]=keyword`.      | `*` (all)     |\n\n## License\n\nThis plugin is released under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeinwp%2Fyourls-api-list-extended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeinwp%2Fyourls-api-list-extended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeinwp%2Fyourls-api-list-extended/lists"}