Skip to main content

Universal Python client for CARAPIS Vehicles API - Access automotive data from 25+ global marketplaces including Cars.com, AutoScout24, Encar, Auto.ru, and more. Enterprise-grade automotive data extraction with real-time vehicle listings, pricing, and market intelligence.

Project description

๐Ÿš— CARAPIS Vehicles API Python Client

PyPI version Python License: MIT Build Status

Universal Python client for the CARAPIS Vehicles API - Access automotive data from 25+ global marketplaces with enterprise-grade reliability.

๐ŸŒ Developed by CARAPIS - The leading automotive data extraction platform serving Fortune 500 companies and automotive professionals worldwide.

๐ŸŒŸ Why Choose CARAPIS Vehicles API?

  • ๐ŸŒ Global Coverage: Access 25+ automotive marketplaces across Asia, Europe, Americas, and Middle East
  • โšก Real-time Data: Live vehicle listings, pricing, and market intelligence
  • ๐Ÿ›ก๏ธ Enterprise-Grade: 99.9% uptime, advanced anti-detection, residential proxies
  • ๐Ÿ Python-First: Full async/await support, type hints, dataclasses
  • ๐Ÿ“Š Market Intelligence: Advanced analytics, price trends, and market insights
  • ๐Ÿš€ Production Ready: Used by automotive dealers, marketplaces, and data companies globally

๐ŸŒ Supported Automotive Platforms

๐Ÿ‡ฐ๐Ÿ‡ท Asia-Pacific

๐Ÿ‡บ๐Ÿ‡ธ North America

๐Ÿ‡ช๐Ÿ‡บ Europe

  • AutoScout24.com - Europe's largest automotive marketplace
  • Mobile.de - Germany's leading automotive platform
  • Auto.ru - Russia's premier automotive marketplace (2M+ listings)
  • Avito.ru - Russian classifieds platform
  • Arabam.com - Turkey's automotive marketplace

๐ŸŒ Global & Regional

๐Ÿš€ Quick Start

Installation

# pip
pip install carapis-api

# poetry
poetry add carapis-api

# pipenv
pipenv install carapis-api

Basic Usage

import asyncio
from carapis import VehiclesAPIClient, CatalogFilters

# Initialize client
client = VehiclesAPIClient(
    base_url="https://api.carapis.com",
    api_key="your-api-key"
)

async def main():
    # Get vehicles with filters
    filters = CatalogFilters(
        brand_code="toyota",
        price_min=10000,
        price_max=50000,
        page_size=20
    )
    
    vehicles = await client.vehicles.list_async(**filters.to_api_params())
    
    print(f"Found {vehicles.count} vehicles")
    for vehicle in vehicles.results:
        print(f"{vehicle.year} {vehicle.brand_name} {vehicle.model_name} - ${vehicle.price}")

# Run async function
asyncio.run(main())

Synchronous Usage

from carapis import VehiclesAPIClient, CatalogFilters

# Initialize client
client = VehiclesAPIClient(
    base_url="https://api.carapis.com", 
    api_key="your-api-key"
)

# Synchronous calls
filters = CatalogFilters(brand_code="bmw", year_min=2020)
vehicles = client.vehicles.list(**filters.to_api_params())

# Get vehicle details
vehicle_detail = client.vehicles.get("vehicle-id")
print(f"Vehicle: {vehicle_detail.display_name}")

Advanced Filtering

from carapis import CatalogFilters

# Advanced search with multiple filters
filters = CatalogFilters(
    search="BMW X5",
    year_min=2020,
    body_type="suv",
    fuel_type="gasoline",
    transmission="automatic",
    mileage_max=50000,
    ordering="-price"  # Sort by price descending
)

vehicles = await client.vehicles.list_async(**filters.to_api_params())

Server-Side Rendering (SSR)

from carapis import VehiclesSSRService, CatalogFilters

# Perfect for Django, FastAPI, Flask
async def get_catalog_data(request):
    filters = CatalogFilters(
        brand_code="toyota",
        page_size=20
    )
    
    catalog_data = await VehiclesSSRService.get_vehicles_for_catalog(
        filters=filters,
        page=1,
        client=client
    )
    
    return {
        'vehicles': catalog_data.vehicles,
        'total_count': catalog_data.total_count,
        'seo': VehiclesSSRService.generate_vehicle_seo(catalog_data.vehicles[0])
    }

Brand and Market Data

# Get all brands
brands = await client.brands.list_async()

# Get brand-specific data
brand_data = await VehiclesSSRService.get_brand_page_data("toyota", client=client)
print(f"Toyota has {brand_data.total_count} vehicles available")
print(f"Average price: ${brand_data.stats.average_price}")

# Market statistics
stats = await client.statistics.get_market_overview_async()
print("Market overview:", stats)

๐Ÿ› ๏ธ API Reference

Core Services

  • VehiclesService - Vehicle listings, search, and details
  • BrandsService - Brand information and brand-specific vehicles
  • SourcesService - Data source management and statistics
  • StatisticsService - Market analytics and insights
  • VehiclesSSRService - Server-side rendering utilities

Type Safety with Dataclasses

Full type safety with Python dataclasses and type hints:

from carapis import (
    CatalogVehicle, CatalogBrand, CatalogFilters,
    VehiclePageData, SEOMetadata
)

# Type-safe filtering
filters = CatalogFilters(
    brand_code="toyota",
    price_min=15000,
    price_max=45000,
    body_type="sedan",
    fuel_type="hybrid"
)

# Type-safe responses
vehicles: VehiclePageData = await VehiclesSSRService.get_vehicles_for_catalog(
    filters=filters, client=client
)

# Access with full IDE support
for vehicle in vehicles.vehicles:
    print(f"{vehicle.display_name}: {vehicle.formatted_price}")
    print(f"Condition Score: {vehicle.condition_score}/100")

๐Ÿ—๏ธ Framework Integration

Django

# views.py
from django.shortcuts import render
from carapis import VehiclesSSRService, CatalogFilters

async def vehicle_catalog(request):
    filters = CatalogFilters(
        search=request.GET.get('search', ''),
        brand_code=request.GET.get('brand'),
        page_size=20
    )
    
    catalog_data = await VehiclesSSRService.get_vehicles_for_catalog(
        filters=filters,
        page=int(request.GET.get('page', 1)),
        client=get_api_client()  # Your client instance
    )
    
    context = {
        'vehicles': catalog_data.vehicles,
        'pagination': {
            'current_page': catalog_data.current_page,
            'total_pages': catalog_data.total_pages,
            'has_next': catalog_data.has_next,
            'has_previous': catalog_data.has_previous
        },
        'seo': VehiclesSSRService.generate_search_seo(
            filters.search or "Vehicles", 
            catalog_data.total_count
        )
    }
    
    return render(request, 'catalog.html', context)

FastAPI

from fastapi import FastAPI, Query
from carapis import VehiclesAPIClient, VehiclesSSRService, CatalogFilters

app = FastAPI()
client = VehiclesAPIClient(base_url="https://api.carapis.com", api_key="your-key")

@app.get("/vehicles/")
async def get_vehicles(
    search: str = Query(None),
    brand: str = Query(None),
    page: int = Query(1),
    page_size: int = Query(20)
):
    filters = CatalogFilters(
        search=search,
        brand_code=brand,
        page_size=page_size
    )
    
    catalog_data = await VehiclesSSRService.get_vehicles_for_catalog(
        filters=filters,
        page=page,
        client=client
    )
    
    return {
        "vehicles": [vehicle.__dict__ for vehicle in catalog_data.vehicles],
        "total_count": catalog_data.total_count,
        "current_page": catalog_data.current_page,
        "total_pages": catalog_data.total_pages
    }

Flask

from flask import Flask, request, jsonify
from carapis import VehiclesAPIClient, CatalogFilters
import asyncio

app = Flask(__name__)
client = VehiclesAPIClient(base_url="https://api.carapis.com", api_key="your-key")

@app.route('/vehicles')
def vehicles():
    filters = CatalogFilters(
        search=request.args.get('search'),
        brand_code=request.args.get('brand'),
        page_size=int(request.args.get('page_size', 20))
    )
    
    # Run async function in sync context
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    
    try:
        vehicles = loop.run_until_complete(
            client.vehicles.list_async(**filters.to_api_params())
        )
        return jsonify({
            'vehicles': [v.__dict__ for v in vehicles.results],
            'count': vehicles.count
        })
    finally:
        loop.close()

๐Ÿ”ง Configuration

Environment Variables

# .env
CARAPIS_API_URL=https://api.carapis.com
CARAPIS_API_KEY=your-api-key-here

Client Configuration

from carapis import VehiclesAPIClient

# Basic configuration
client = VehiclesAPIClient(
    base_url="https://api.carapis.com",
    api_key="your-api-key",
    timeout=30,
    verify_ssl=True
)

# Check authentication
if client.is_authenticated():
    print("Client is authenticated")

# Custom headers
client.set_custom_headers({
    'User-Agent': 'MyApp/1.0',
    'Accept-Language': 'en-US,en;q=0.9'
})

๐Ÿ“Š Use Cases

๐Ÿช Automotive Marketplaces

  • Build comprehensive vehicle catalogs
  • Real-time inventory management
  • Competitive pricing analysis
  • Market trend monitoring

๐Ÿข Dealerships & Dealers

  • Inventory optimization
  • Pricing strategies
  • Market research
  • Lead generation

๐Ÿ“ˆ Data Analytics & Research

  • Market intelligence reports
  • Price trend analysis
  • Consumer behavior insights
  • Regional market studies

๐Ÿ”ง Automotive Apps & Platforms

  • Vehicle comparison tools
  • Price estimation services
  • Market analysis dashboards
  • Automotive data enrichment

๐ŸŒŸ Enterprise Features

  • ๐Ÿ”’ Secure Authentication - API key and token-based auth
  • ๐Ÿ“Š Rate Limiting - Intelligent request throttling
  • ๐Ÿ›ก๏ธ Anti-Detection - Advanced proxy rotation and headers
  • ๐Ÿ“ˆ Analytics - Comprehensive usage statistics
  • ๐Ÿ”ง Custom Integration - Tailored solutions for enterprise needs
  • ๐Ÿ“ž 24/7 Support - Dedicated technical support team

๐Ÿ“š Documentation & Resources

๐Ÿค Support & Community

๐Ÿ“„ License

MIT License - see the LICENSE file for details.

๐Ÿข About CARAPIS

CARAPIS is the world's leading automotive data extraction platform, trusted by Fortune 500 companies, automotive dealers, and data-driven businesses globally. We provide real-time access to automotive data from 25+ international marketplaces with enterprise-grade reliability and advanced anti-detection technology.

Why Choose CARAPIS?

  • ๐ŸŒ Global Leader - Serving 1000+ clients worldwide
  • ๐Ÿ”’ Enterprise Security - SOC 2 compliant, GDPR ready
  • โšก High Performance - 99.9% uptime, sub-second response times
  • ๐Ÿ›ก๏ธ Anti-Detection - Advanced proxy networks and rotation
  • ๐Ÿ“Š Market Intelligence - Deep automotive market insights
  • ๐Ÿค Expert Support - Dedicated technical and business support

Ready to access global automotive data? Get your API key and start building with CARAPIS today!

Get Started

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carapis_api-2.0.3.tar.gz (70.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carapis_api-2.0.3-py3-none-any.whl (159.7 kB view details)

Uploaded Python 3

File details

Details for the file carapis_api-2.0.3.tar.gz.

File metadata

  • Download URL: carapis_api-2.0.3.tar.gz
  • Upload date:
  • Size: 70.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for carapis_api-2.0.3.tar.gz
Algorithm Hash digest
SHA256 74639ae60741726c56a43dc0a238bbe30702fa6ef5bc42a7a3fc6b47c189cbcb
MD5 519c142e36c3eb4b2c3bd2ec1aac6c39
BLAKE2b-256 1c8cec9bdb415cfd3be75788be46b076bf02a446f10dd18c1dbecb378a6ce11a

See more details on using hashes here.

File details

Details for the file carapis_api-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: carapis_api-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 159.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for carapis_api-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 150acf247e4cd41e97c33c9fed01df97fc427ab74d74f86fc6be9ad48d851005
MD5 896463ac82c31401941b2dc228dd7140
BLAKE2b-256 d73cb769fc2add401bc8b4a102e7df979e8dbdfb43f4e9177aaa4dfe31bd4b23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page