{"id":23835335,"url":"https://github.com/amirreza-jabbari/crypto-api","last_synced_at":"2026-05-14T21:33:06.556Z","repository":{"id":270475547,"uuid":"910470541","full_name":"Amirreza-Jabbari/Crypto-API","owner":"Amirreza-Jabbari","description":"This project is a Django-based API that allows users to retrieve cryptocurrency data either for the current date or for a specified date. The data is scraped from CoinCodex.","archived":false,"fork":false,"pushed_at":"2024-12-31T23:54:21.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T20:49:23.571Z","etag":null,"topics":["api","crypto-api","cryptocurrency","django","django-rest-framework"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"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/Amirreza-Jabbari.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,"zenodo":null}},"created_at":"2024-12-31T11:09:07.000Z","updated_at":"2024-12-31T23:54:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"e119ebf6-e01e-4062-ac82-d3f370da3a70","html_url":"https://github.com/Amirreza-Jabbari/Crypto-API","commit_stats":null,"previous_names":["amirreza-jabbari/crypto-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Amirreza-Jabbari/Crypto-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amirreza-Jabbari%2FCrypto-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amirreza-Jabbari%2FCrypto-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amirreza-Jabbari%2FCrypto-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amirreza-Jabbari%2FCrypto-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Amirreza-Jabbari","download_url":"https://codeload.github.com/Amirreza-Jabbari/Crypto-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amirreza-Jabbari%2FCrypto-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33044115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","crypto-api","cryptocurrency","django","django-rest-framework"],"created_at":"2025-01-02T15:48:01.283Z","updated_at":"2026-05-14T21:33:06.539Z","avatar_url":"https://github.com/Amirreza-Jabbari.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿### **Crypto API: a Django-based API to retrieve cryptocurrency data**\r\n\r\n\r\nA Django-based API for scraping cryptocurrency data from [CoinCodex](https://coincodex.com) and providing it in a structured JSON format.\r\n\r\n## Features\r\n\r\n- Scrape live cryptocurrency data, including:\r\n  - Rank\r\n  - Name\r\n  - Ticker\r\n  - Price\r\n  - 24-hour price change\r\n  - Market cap\r\n  - 24-hour trading volume\r\n  - Circulating supply\r\n- Fetch data for a specific date using a POST request.\r\n- Fetch data for the current date using a GET request.\r\n- Data validation and error handling for user input.\r\n- API response formatted using Django REST Framework serializers.\r\n\r\n---\r\n\r\n## Endpoints\r\n\r\n### 1. **GET `/api/get-crypto-data/`**\r\nFetch cryptocurrency data for the current date.\r\n\r\n#### Example Request\r\n```bash\r\ncurl -X GET http://127.0.0.1:8000/api/get-crypto-data/\r\n```\r\n\r\n#### Example Response\r\n```json\r\n[\r\n  {\r\n    \"index\": \"1\",\r\n    \"name\": \"Bitcoin\",\r\n    \"ticker\": \"BTC\",\r\n    \"price\": \"$30,000\",\r\n    \"change_24h\": \"2.5%\",\r\n    \"market_cap\": \"$600B\",\r\n    \"volume_24h\": \"$40B\",\r\n    \"circulating_supply\": \"19M BTC\"\r\n  },\r\n  ...\r\n]\r\n```\r\n\r\n---\r\n\r\n### 2. **POST `/api/get-crypto-data/`**\r\nFetch cryptocurrency data for a specific date.\r\n\r\n#### Request Body\r\n| Parameter | Type   | Description                 |\r\n|-----------|--------|-----------------------------|\r\n| `date`    | string | Date in `YYYY-MM-DD` format |\r\n\r\n#### Example Request\r\n```bash\r\ncurl -X POST http://127.0.0.1:8000/api/get-crypto-data/ \\\r\n-H \"Content-Type: application/json\" \\\r\n-d '{\"date\": \"2023-01-01\"}'\r\n```\r\n\r\n#### Example Response\r\n```json\r\n[\r\n  {\r\n    \"index\": \"1\",\r\n    \"name\": \"Bitcoin\",\r\n    \"ticker\": \"BTC\",\r\n    \"price\": \"$30,000\",\r\n    \"change_24h\": \"2.5%\",\r\n    \"market_cap\": \"$600B\",\r\n    \"volume_24h\": \"$40B\",\r\n    \"circulating_supply\": \"19M BTC\"\r\n  },\r\n  ...\r\n]\r\n```\r\n\r\n#### Error Responses\r\n- **400 Bad Request**: Missing or invalid date format.\r\n- **500 Internal Server Error**: Unable to scrape data from the source.\r\n\r\n---\r\n\r\n## Setup and Installation\r\n\r\n### Prerequisites\r\n- Python 3.8 or higher\r\n- Django 4.0 or higher\r\n- Django REST Framework\r\n- `requests` library\r\n- `beautifulsoup4` library\r\n\r\n### Installation Steps\r\n\r\n1. **Clone the repository**\r\n   ```bash\r\n   git clone https://github.com/Amirreza-Jabbari/Crypto-API.git\r\n   cd Crypto-API\r\n   ```\r\n\r\n2. **Set up a virtual environment**\r\n   ```bash\r\n   python -m venv venv\r\n   source venv/bin/activate   # On Windows: venv\\Scripts\\activate\r\n   ```\r\n\r\n3. **Install dependencies**\r\n   ```bash\r\n   pip install -r requirements.txt\r\n   ```\r\n\r\n4. **Run the server**\r\n   ```bash\r\n   python manage.py runserver\r\n   ```\r\n\r\n5. **Access the API**\r\n   - Use [http://127.0.0.1:8000/api/get-crypto-data/](http://127.0.0.1:8000/api/get-crypto-data/) for GET requests.\r\n   - Use the same URL with a POST request and a `date` parameter to fetch data for a specific date.\r\n\r\n---\r\n\r\n## Dependencies\r\n\r\n- Django\r\n- Django REST Framework\r\n- requests\r\n- beautifulsoup4\r\n\r\nInstall them with:\r\n```bash\r\npip install django djangorestframework requests beautifulsoup4\r\n```\r\n\r\n---\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the `LICENSE` file for more details.\r\n\r\n---\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirreza-jabbari%2Fcrypto-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famirreza-jabbari%2Fcrypto-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirreza-jabbari%2Fcrypto-api/lists"}