{"id":17793932,"url":"https://github.com/nora-soderlund/google-maps-solar-api","last_synced_at":"2025-07-19T17:12:33.824Z","repository":{"id":192141408,"uuid":"686145955","full_name":"nora-soderlund/google-maps-solar-api","owner":"nora-soderlund","description":"A TypeScript implementation of Google Maps Solar API endpoints.","archived":false,"fork":false,"pushed_at":"2023-12-24T18:24:30.000Z","size":74,"stargazers_count":26,"open_issues_count":0,"forks_count":15,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-02-27T13:20:11.996Z","etag":null,"topics":["google-maps","solar-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nora-soderlund.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-01T21:32:31.000Z","updated_at":"2024-12-15T01:14:08.000Z","dependencies_parsed_at":"2024-10-27T11:14:39.262Z","dependency_job_id":"6aa00e16-f97e-4640-9289-a39b64852684","html_url":"https://github.com/nora-soderlund/google-maps-solar-api","commit_stats":null,"previous_names":["nora-soderlund/google-maps-solar-api"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nora-soderlund%2Fgoogle-maps-solar-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nora-soderlund%2Fgoogle-maps-solar-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nora-soderlund%2Fgoogle-maps-solar-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nora-soderlund%2Fgoogle-maps-solar-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nora-soderlund","download_url":"https://codeload.github.com/nora-soderlund/google-maps-solar-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243551251,"owners_count":20309293,"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":["google-maps","solar-api"],"created_at":"2024-10-27T11:14:35.424Z","updated_at":"2025-03-16T20:31:12.620Z","avatar_url":"https://github.com/nora-soderlund.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# google-maps-solar-api\nThis is a TypeScript package for calling the new Solar API endpoints, including full types for all query inputs and body responses.\n\n## Get started\n```\nnpm install @nora-soderlund/google-maps-solar-api\n```\n\n### Getting building insights from a coordinate\n```ts\nimport { findClosestBuildingInsights } from \"@nora-soderlund/google-maps-solar-api\";\n\nconst buildingInsights = await findClosestBuildingInsights(\"API_KEY\", {\n  location: {\n    latitude: 57.70936,\n    longitude: 11.97345\n  }\n});\n```\n\n### Getting data layers from a coordinate\n```ts\nimport { getDataLayers } from \"@nora-soderlund/google-maps-solar-api\";\n\nconst dataLayers = await getDataLayers(\"API_KEY\", {\n  location: coordinate,\n  radiusMeters: 100,\n  view: \"IMAGERY_AND_ANNUAL_FLUX_LAYERS\"\n});\n```\n\n### Using a proxy URL instead of API key\nYou can use your own Solar API proxy to implement this package in your clients and apply rate limiting or session authentication on your end.\n\nSimply pass a URL object instead of a string in replacement of the API key. Only the host will be used, the protocol must be HTTPS.\n```ts\nimport { findClosestBuildingInsights } from \"@nora-soderlund/google-maps-solar-api\";\n\nconst proxyUrl = new URL(\"https://my-solar-api-proxy.com\");\n\nconst buildingInsights = await findClosestBuildingInsights(proxyUrl, {\n  location: {\n    latitude: 57.70936,\n    longitude: 11.97345\n  }\n});\n```\n\nSubsequent request will be sent to e.g. `https://my-solar-api-proxy.com/v1/buildingInsights:findClosest?...`.\n\n### Implementation examples\nSee my developer blog article for an example of using the Solar API data layers with a dynamic Google Maps instance:\n\nhttps://nora-soderlund.com/articles/integrating-the-new-solar-api-in-google-maps\n\nAnother example of visualizing potential solar panel placements in dynamic maps:\n\nhttps://nora-soderlund.com/articles/visualizing-potential-solar-panel-placements-in-google-maps\n\n## References\n\n### Building Insights\n#### findClosestBuildingInsights\n```ts\nfindClosestBuildingInsights(apiKeyOrProxyUrl: string | URL, query: FindClosestBuildingInsightsParameters): Promise\u003cBuildingInsights\u003e\n```\nReturns a [BuildingInsights](https://github.com/nora-soderlund/google-maps-solar-api/blob/main/src/types/BuildingInsights.ts) object or throws a generic Error if the request failed.\n\nSee [buildingInsights.findClosest](https://developers.google.com/maps/documentation/solar/reference/rest/v1/buildingInsights/findClosest) on the Solar API reference.\n\n---\n\n### Data Layers\n#### getDataLayers\n```ts\ngetDataLayers(apiKeyOrProxyUrl: string | URL, query: GetDataLayersParameters): Promise\u003cDataLayers\u003e\n```\nReturns a [DataLayers](https://github.com/nora-soderlund/google-maps-solar-api/blob/main/src/types/DataLayers.ts) object or throws a generic Error if the request failed.\n\nSee [dataLayers.get](https://developers.google.com/maps/documentation/solar/reference/rest/v1/dataLayers/get) on the Solar API reference.\n\n---\n\n#### `getGeoTiff(apiKeyOrProxyUrl: string | URL, url: string): Promise\u003cArrayBuffer\u003e`\nReturns a raw [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) object of the GeoTIFF file or throws a generic Error if the request failed.\n\nSee [geoTiff.get](https://developers.google.com/maps/documentation/solar/reference/rest/v1/geoTiff/get) on the Solar API reference.\n\n---\n\n### Helpers\n#### getDataLayersForBounds\n```ts\ngetDataLayersForBounds(bounds: LatLngBox, pixelSizeMeters: number, paddingMeters: number = 0): DataLayerBounds\n```\nUsed for getting a connected area coverage. Does not perform any asynchronous requests. Returns a [DataLayerBounds](#datalayerbounds) object. \n\n---\n\n#### DataLayerBounds\n```ts\ndataLayerView: DataLayerView;\n```\nThe highest supported data layer view, for radius meters over 175m, the DataLayerView in the request must not include monthly flux or hourly shade.\n\n##### tiles\n```ts\ntiles: LatLng[];\n```\nThe tiles that make up the generated bounds, use with `radiusMetersPerTile`\n\n##### radiusMetersPerTile\n```ts\nradiusMetersPerTile: number;\n```\nThe radius in meters for each tile.\n\n##### bounds\n```ts\nbounds: LatLngBox;\n```\nThe generated bounds for the new tiles.\n\n##### horizontalTiles\n```ts\nhorizontalTiles: number;\n```\n##### verticalTiles\n```ts\nverticalTiles: number;\n```\nThe horizontal and vertical tiles count. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnora-soderlund%2Fgoogle-maps-solar-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnora-soderlund%2Fgoogle-maps-solar-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnora-soderlund%2Fgoogle-maps-solar-api/lists"}