{"id":19932443,"url":"https://github.com/adamwulf/automatic-php-api","last_synced_at":"2025-05-03T11:32:18.015Z","repository":{"id":11237239,"uuid":"13631983","full_name":"adamwulf/automatic-php-api","owner":"adamwulf","description":"A barebones PHP API for the Automatic API","archived":false,"fork":false,"pushed_at":"2019-07-04T06:24:37.000Z","size":17,"stargazers_count":24,"open_issues_count":1,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-07T15:11:11.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.automatic.com/developer/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"markn86/moodle-mod_certificate","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamwulf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-16T21:37:55.000Z","updated_at":"2019-07-14T15:25:42.000Z","dependencies_parsed_at":"2022-07-12T15:04:14.036Z","dependency_job_id":null,"html_url":"https://github.com/adamwulf/automatic-php-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwulf%2Fautomatic-php-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwulf%2Fautomatic-php-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwulf%2Fautomatic-php-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwulf%2Fautomatic-php-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamwulf","download_url":"https://codeload.github.com/adamwulf/automatic-php-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252184783,"owners_count":21708018,"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":[],"created_at":"2024-11-12T23:10:11.391Z","updated_at":"2025-05-03T11:32:17.747Z","avatar_url":"https://github.com/adamwulf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automatic PHP API\n\nThis is a PHP client library for the Automatic API (http://www.automatic.com/). The Automatic Link plugs into your car's data port and connects to your phone to help you track and improve your driving habits. This API gives you access to the data stored in your Automatic account, including some of your car information and driving history. The Automatic API is in early alpha, and more functionality is expected to be released soon.\n\n## Authentication\n\nThe Automatic API uses OAuth2 to authenticate against their website.\n\n## Cloning this Repo\n\nThis repo uses a PHP OAuth2 library for authentication as a submodule. When cloning, be sure to:\n\n```\n$ git clone git@github.com:adamwulf/automatic-php-api.git\n$ cd automatic-php-api\n$ git submodule init\n$ git submodule update\n```\n\n\n## Usage\n\nBelow is a simple code snippet that shows how to authenticate with the API and send requests to fetch the user's trip information.\n\n\n```\n$automatic = new Automatic($your_client_id, $your_client_secret);\n\n// logging in with OAuth2 code\nif (/* have a stored token somewhere in $_SESSION or the database */){\n    $automatic-\u003esetOAuthToken($the_stored_token_to_reuse);\n}else if (!isset($_GET['code'])){\n\t// we don't have a token stored, so fetch one\n\t$scopes = array(\"scope:location\", \"scope:vehicle\", \"scope:trip:summary\");\n\t$auth_url = $automatic-\u003eauthenticationURLForScopes($scopes);\n    header('Location: ' . $auth_url);\n    die('Redirect');\n}\nelse\n{\n    $response_token = $automatic-\u003egetTokenForCode($_GET[\"code\"]);\n    // store and re-use this $response_token to save the user's login\n    // across multiple requests\n    $automatic-\u003esetOAuthToken($response_token);\n}\n\n$trip_data = $automatic-\u003egetTrips();\n```\n\n## Documentation\n\nThe Automatic API documentation is available at: https://www.automatic.com/developer/documentation/\n\nMore information is available at: https://www.automatic.com/developer/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamwulf%2Fautomatic-php-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamwulf%2Fautomatic-php-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamwulf%2Fautomatic-php-api/lists"}