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.4.tar.gz (70.9 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.4-py3-none-any.whl (164.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: carapis_api-2.0.4.tar.gz
  • Upload date:
  • Size: 70.9 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.4.tar.gz
Algorithm Hash digest
SHA256 e3b470d58c6daffa1a5205c2e130a78e2d14258503e13cd266a95fa4245f6a2a
MD5 4bb78b4251aefc63c5f9b453b779bbbe
BLAKE2b-256 e0ada036e75994843540b1b4405cdefa66f1ceee4cef5e1de63a46ba7bb039db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: carapis_api-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 164.4 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a890e5f8a2036bfe18f7f220ec8be5bd4861d3880655210b3f256be595b7d835
MD5 da4df783918ab0b303bb0824201e9477
BLAKE2b-256 8b7f4634b9b484f92c20d744d1d2ed81786d64a8d8b1869b96f54cc4c228e2ab

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