Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkopecky authored Oct 9, 2024
1 parent 888d892 commit 0619137
Showing 1 changed file with 1 addition and 42 deletions.
43 changes: 1 addition & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The API also provides reduce operations, enabling users to perform aggregate cal

## Hyperplan API Quickstart with Python: Accessing Parcel Data

This quickstart guide will show you how to retrieve parcel information using Hyperplan's API and the HyperClient Python library. This example focuses on retrieving parcel-specific data, showcasing a core functionality of the API.
This [quickstart](./docs/quickstart.md) guide will show you how to retrieve parcel information using Hyperplan's API and the HyperClient Python library. This example focuses on retrieving parcel-specific data, showcasing a core functionality of the API.

**Before you Begin**:

Expand All @@ -49,45 +49,4 @@ This quickstart guide will show you how to retrieve parcel information using Hyp

**Note**: This guide assumes you have a basic understanding of Python and making API requests.

```python
from hyperclient import HyperClient # Assuming 'hyperclient' is how you import HyperClient

# Replace with your actual API endpoint and authentication token
API_ENDPOINT = "https://api.hyperplan.com"
API_TOKEN = "YOUR_API_TOKEN"

# Create a HyperClient instance
client = HyperClient(API_ENDPOINT, API_TOKEN)

# Define the parcel ID for which you want to retrieve data
parcel_id = 12345

# Make the API request to get parcel data
response = client.get(f"/v1/parcels/{parcel_id}")

# Process the response
if response.status_code == 200:
parcel_data = response.json()
print(parcel_data)
else:
print(f"Error: {response.status_code}")
print(response.text)
```

**Explanation**:

* This code snippet first initializes the HyperClient with your API endpoint and token.
* It then constructs the API endpoint URL for retrieving a specific parcel using the provided `parcel_id`.
* A GET request is made using `client.get()`, and the response is stored.
* The code then checks for a successful response (status code 200) and parses the JSON data. If successful, it prints the parcel data; otherwise, it prints the error code and message.

**Key Points**:

* The `/v1/parcels/{parcel_id}` endpoint is used to retrieve data for a specific parcel.
* The HyperClient library handles authentication and simplifies making API requests.
* You can modify this example to include filters for labels, years, and weeks to refine the data retrieved.

This quickstart provides a basic example of using the Hyperplan API. You can find more details and advanced use cases in the [API documentation](./docs/api_reference.md)



0 comments on commit 0619137

Please sign in to comment.