This API is especially useful for gauging the size of extracts before sending to clients (desktop or mobile).
Downloading and processing large amounts (10-50MB+) of GeoJSON on mobile or old devices can significantly
impact the end user experience.
This endpoint requires the growth plan because it uses thousands of expensive geometric operations.
This request takes a single WKT geometry as the PUT request body (ASCII/UTF8 encoded).Coordinates are in WGS84 (EPSG:4326) and ordered longitude, latitude. All counted geometries
will intersect with the uploaded geometry.
All features counted will satisfy each of the passed tags given by this parameter.
tags is formatted as a list of tags, each like key=value.You can create a tag list by forming an array of key=value items and joining
them into one string with the & character.This list must be URL encoded because both = and & are reserved characters in URI.An example list of tags could be leisure=park and name=Westglen Park. This matches parks
that have the name Westglen Park. To set this parameter,
we’ll URL encode leisure=park&name=Westglen Park.Documentation on tags can be found on the TagInfo resource website.
When features are successfully counted, a 200 OK response will be
issued, with Content-Type: application/json. The body will have a property feature_count
which will be an unsigned integer representing the number of features matching the tags and bounding box.
In the event of an error, an error response will be issued, usually with a 5xx error code.
The error will be JSON-formatted, with an error field describing the cause.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Bunting Labs Docs","colors":{"primary":"#570DF8","light":"#e9d5ff","dark":"#14B8A6"},"favicon":"/logo/light.png","logo":{"light":"https://mintlify.s3.us-west-1.amazonaws.com/buntinglabs/logo/light.png","dark":"https://mintlify.s3.us-west-1.amazonaws.com/buntinglabs/logo/dark.png"},"navbar":{"links":[{"label":"Documentation","href":"https://docs.buntinglabs.com/"}],"primary":{"type":"button","label":"Get an API Key","href":"https://buntinglabs.com/account/register"}},"footer":{"socials":{"twitter":"https://twitter.com/BuntingLabs","github":"https://github.com/BuntingLabs","linkedin":"https://www.linkedin.com/company/bunting-labs/"}},"integrations":{"posthog":{"apiKey":"phc_zmDRTwTSkhXORGB1qzjSZIMH7N7DgG4qb0cxZFn2kQs"}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"buntinglabs","hasAudioNarration":false,"actualSubdomain":"buntinglabs","customDomains":["docs.buntinglabs.com"],"gitSource":{"type":"github","owner":"buntinglabs","repo":"api-docs","deployBranch":"main","contentDirectory":"","mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae9140c39acb9aed2b3eb2e:success","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"OpenStreetMap API","count":7},{"language":"default","tag":"US Census API","count":2},{"language":"default","tag":"Data from Satellite Imagery","count":1},{"language":"default","tag":"Coordinate Geometry API","count":1},{"language":"default","tag":"Home","count":1},{"language":"default","tag":"Points of Interest API","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"openstreetmap-api/count-within-geometry","slug":"/openstreetmap-api/count-within-geometry","pageMetadata":{"title":"Count within Geometry","description":"This endpoint searches for features matching tags inside an uploaded WKT geometry, then gives the total count and GeoJSON download size.","api":"PUT https://osm.buntinglabs.com/v1/osm/count","href":"/openstreetmap-api/count-within-geometry"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"This endpoint searches for features matching tags inside an uploaded WKT geometry, then gives the total count and GeoJSON download size.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,..._provideComponents(),...props.components},{Heading,Note,ParamField,ResponseField}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`This API is especially useful for gauging the size of extracts before sending to clients (desktop or mobile).\nDownloading and processing large amounts (10-50MB+) of GeoJSON on mobile or old devices can significantly\nimpact the end user experience.`}),`\n`,_jsxs(Note,{children:[`This endpoint requires the `,_jsx(_components.a,{href:`https://buntinglabs.com/pricing`,children:`growth plan`}),` because it uses thousands of expensive geometric operations.`]}),`\n`,_jsx(Heading,{level:`3`,id:`body`,children:`Body`}),`\n`,_jsxs(_components.p,{children:[`This request takes a single WKT geometry as the `,_jsx(_components.code,{children:`PUT`}),` request body (ASCII/UTF8 encoded).`]}),`\n`,_jsx(_components.p,{children:`Coordinates are in WGS84 (EPSG:4326) and ordered longitude, latitude. All counted geometries\nwill intersect with the uploaded geometry.`}),`\n`,_jsx(Heading,{level:`3`,id:`request-parameters`,children:`Request Parameters`}),`\n`,_jsxs(ParamField,{query:`tags`,type:`string`,placeholder:`leisure=park`,required:true,id:`param-tags`,children:[_jsxs(_components.p,{children:[`All features counted will satisfy each of the passed tags given by this parameter.\n`,_jsx(_components.code,{children:`tags`}),` is formatted as a list of tags, each like `,_jsx(_components.code,{children:`key=value`}),`.`]}),_jsxs(_components.p,{children:[`You can create a tag list by forming an array of `,_jsx(_components.code,{children:`key=value`}),` items and joining\nthem into one string with the `,_jsx(_components.code,{children:`\u0026`}),` character.`]}),_jsxs(_components.p,{children:[`This list must be URL encoded because both `,_jsx(_components.code,{children:`=`}),` and `,_jsx(_components.code,{children:`\u0026`}),` are reserved characters in URI.`]}),_jsxs(_components.p,{children:[`An example list of tags could be `,_jsx(_components.code,{children:`leisure=park`}),` and `,_jsx(_components.code,{children:`name=Westglen Park`}),`. This matches parks\nthat have the name Westglen Park. To set this parameter,\nwe’ll URL encode `,_jsx(_components.code,{children:`leisure=park\u0026name=Westglen Park`}),`.`]}),_jsxs(_components.p,{children:[`Documentation on tags can be found on the `,_jsx(_components.a,{href:`https://taginfo.openstreetmap.org`,children:`TagInfo`}),` resource website.`]})]}),`\n`,_jsx(ParamField,{query:`api_key`,type:`string`,placeholder:`demo`,required:true,id:`param-api-key`,children:_jsxs(_components.p,{children:[`Your account’s API key. You can create an API key by\n`,_jsx(_components.a,{href:`https://buntinglabs.com/account/register`,children:`registering for an account`}),`\nand copy and paste it from your `,_jsx(_components.a,{href:`https://buntinglabs.com/dashboard`,children:`account dashboard`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`When features are successfully counted, a 200 OK response will be\nissued, with `,_jsx(_components.code,{children:`Content-Type: application/json`}),`. The body will have a property `,_jsx(_components.code,{children:`feature_count`}),`\nwhich will be an unsigned integer representing the number of features matching the tags and bounding box.`]}),`\n`,_jsx(ResponseField,{name:`feature_count`,type:`number`,id:`param-feature-count`,children:_jsx(_components.p,{children:`The number of features matching the filter tags and bounding box.`})}),`\n`,_jsx(ResponseField,{name:`response_bytes`,type:`number`,id:`param-response-bytes`,children:_jsxs(_components.p,{children:[`The size of the GeoJSON response, in bytes, that one would get if the same query\nwere used to `,_jsx(_components.a,{href:`/openstreetmap-api/extract-within-geometry`,children:`extract features from OSM inside a polygon`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`In the event of an error, an error response will be issued, usually with a 5xx error code.\nThe error will be JSON-formatted, with an `,_jsx(_components.code,{children:`error`}),` field describing the cause.`]}),`\n`,_jsxs(ResponseField,{name:`error`,type:`string`,id:`param-error`,children:[_jsx(_components.p,{children:`The error message if the extract request parameters were incorrectly formatted.`}),_jsx(_components.p,{children:`This response field will not be present if the extract succeeds.`})]}),`\n`,_jsx(Heading,{level:`3`,id:`data-license`,children:`Data License`}),`\n`,_jsxs(_components.p,{children:[`This API serves `,_jsx(_components.a,{href:`https://www.openstreetmap.org/`,children:`OpenStreetMap`}),` data, which is\nfreely available and is licensed under the\n`,_jsx(_components.a,{href:`https://www.openstreetmap.org/copyright`,children:`Open Data Commons Open Database License (ODbL)`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Count within Geometry","description":"This endpoint searches for features matching tags inside an uploaded WKT geometry, then gives the total count and GeoJSON download size.","api":"PUT https://osm.buntinglabs.com/v1/osm/count","href":"/openstreetmap-api/count-within-geometry"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`This API is especially useful for gauging the size of extracts before sending to clients (desktop or mobile).\nDownloading and processing large amounts (10-50MB+) of GeoJSON on mobile or old devices can significantly\nimpact the end user experience.`}),`\n`,_jsxs(Note,{children:[`This endpoint requires the `,_jsx(_components.a,{href:`https://buntinglabs.com/pricing`,children:`growth plan`}),` because it uses thousands of expensive geometric operations.`]}),`\n`,_jsx(Heading,{level:`3`,id:`body`,children:`Body`}),`\n`,_jsxs(_components.p,{children:[`This request takes a single WKT geometry as the `,_jsx(_components.code,{children:`PUT`}),` request body (ASCII/UTF8 encoded).`]}),`\n`,_jsx(_components.p,{children:`Coordinates are in WGS84 (EPSG:4326) and ordered longitude, latitude. All counted geometries\nwill intersect with the uploaded geometry.`}),`\n`,_jsx(Heading,{level:`3`,id:`request-parameters`,children:`Request Parameters`}),`\n`,_jsxs(ParamField,{query:`tags`,type:`string`,placeholder:`leisure=park`,required:true,id:`param-tags`,children:[_jsxs(_components.p,{children:[`All features counted will satisfy each of the passed tags given by this parameter.\n`,_jsx(_components.code,{children:`tags`}),` is formatted as a list of tags, each like `,_jsx(_components.code,{children:`key=value`}),`.`]}),_jsxs(_components.p,{children:[`You can create a tag list by forming an array of `,_jsx(_components.code,{children:`key=value`}),` items and joining\nthem into one string with the `,_jsx(_components.code,{children:`\u0026`}),` character.`]}),_jsxs(_components.p,{children:[`This list must be URL encoded because both `,_jsx(_components.code,{children:`=`}),` and `,_jsx(_components.code,{children:`\u0026`}),` are reserved characters in URI.`]}),_jsxs(_components.p,{children:[`An example list of tags could be `,_jsx(_components.code,{children:`leisure=park`}),` and `,_jsx(_components.code,{children:`name=Westglen Park`}),`. This matches parks\nthat have the name Westglen Park. To set this parameter,\nwe’ll URL encode `,_jsx(_components.code,{children:`leisure=park\u0026name=Westglen Park`}),`.`]}),_jsxs(_components.p,{children:[`Documentation on tags can be found on the `,_jsx(_components.a,{href:`https://taginfo.openstreetmap.org`,children:`TagInfo`}),` resource website.`]})]}),`\n`,_jsx(ParamField,{query:`api_key`,type:`string`,placeholder:`demo`,required:true,id:`param-api-key`,children:_jsxs(_components.p,{children:[`Your account’s API key. You can create an API key by\n`,_jsx(_components.a,{href:`https://buntinglabs.com/account/register`,children:`registering for an account`}),`\nand copy and paste it from your `,_jsx(_components.a,{href:`https://buntinglabs.com/dashboard`,children:`account dashboard`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`When features are successfully counted, a 200 OK response will be\nissued, with `,_jsx(_components.code,{children:`Content-Type: application/json`}),`. The body will have a property `,_jsx(_components.code,{children:`feature_count`}),`\nwhich will be an unsigned integer representing the number of features matching the tags and bounding box.`]}),`\n`,_jsx(ResponseField,{name:`feature_count`,type:`number`,id:`param-feature-count`,children:_jsx(_components.p,{children:`The number of features matching the filter tags and bounding box.`})}),`\n`,_jsx(ResponseField,{name:`response_bytes`,type:`number`,id:`param-response-bytes`,children:_jsxs(_components.p,{children:[`The size of the GeoJSON response, in bytes, that one would get if the same query\nwere used to `,_jsx(_components.a,{href:`/openstreetmap-api/extract-within-geometry`,children:`extract features from OSM inside a polygon`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`In the event of an error, an error response will be issued, usually with a 5xx error code.\nThe error will be JSON-formatted, with an `,_jsx(_components.code,{children:`error`}),` field describing the cause.`]}),`\n`,_jsxs(ResponseField,{name:`error`,type:`string`,id:`param-error`,children:[_jsx(_components.p,{children:`The error message if the extract request parameters were incorrectly formatted.`}),_jsx(_components.p,{children:`This response field will not be present if the extract succeeds.`})]}),`\n`,_jsx(Heading,{level:`3`,id:`data-license`,children:`Data License`}),`\n`,_jsxs(_components.p,{children:[`This API serves `,_jsx(_components.a,{href:`https://www.openstreetmap.org/`,children:`OpenStreetMap`}),` data, which is\nfreely available and is licensed under the\n`,_jsx(_components.a,{href:`https://www.openstreetmap.org/copyright`,children:`Open Data Commons Open Database License (ODbL)`}),`.`]}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` PUT`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://osm.buntinglabs.com/v1/osm/count?api_key=YOUR_API_KEY\u0026tags=name%3DNew%20Mexico%20State%20Capitol\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --data`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POLYGON((-109.0448 36.9971,-109.0489 31.3337,-108.2140 31.3349,-108.2071 31.7795,-106.5317 31.7830,-106.6223 32.0034,-103.0696 31.9999,-103.0023 36.9982,-109.0475 36.9982,-109.0448 36.9971))\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`9`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` params`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` URLSearchParams`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` api_key:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` tags:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name=New Mexico State Capitol\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` body`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POLYGON((-109.0448 36.9971,-109.0489 31.3337,-108.2140 31.3349,-108.2071 31.7795,-106.5317 31.7830,-106.6223 32.0034,-103.0696 31.9999,-103.0023 36.9982,-109.0475 36.9982,-109.0448 36.9971))\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`https://osm.buntinglabs.com/v1/osm/count?\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`params`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'PUT'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`body`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`then`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`then`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`params `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"tags\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"name=New Mexico State Capitol\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POLYGON((-109.0448 36.9971,-109.0489 31.3337,-108.2140 31.3349,-108.2071 31.7795,-106.5317 31.7830,-106.6223 32.0034,-103.0696 31.9999,-103.0023 36.9982,-109.0475 36.9982,-109.0448 36.9971))\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.put(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://osm.buntinglabs.com/v1/osm/count\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`params`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`params, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(response.json())`})]}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`Response`,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"feature_count\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"response_bytes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2342`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Count within Geometry","description":"This endpoint searches for features matching tags inside an uploaded WKT geometry, then gives the total count and GeoJSON download size.","api":"PUT https://osm.buntinglabs.com/v1/osm/count","href":"/openstreetmap-api/count-within-geometry"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Body","slug":"body","depth":3,"children":[]},{"title":"Request Parameters","slug":"request-parameters","depth":3,"children":[]},{"title":"Response","slug":"response","depth":3,"children":[]},{"title":"Data License","slug":"data-license","depth":3,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"3\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> PUT\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --url\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://osm.buntinglabs.com/v1/osm/count?api_key=YOUR_API_KEY\u0026#x26;tags=name%3DNew%20Mexico%20State%20Capitol\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --data\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"POLYGON((-109.0448 36.9971,-109.0489 31.3337,-108.2140 31.3349,-108.2071 31.7795,-106.5317 31.7830,-106.6223 32.0034,-103.0696 31.9999,-103.0023 36.9982,-109.0475 36.9982,-109.0448 36.9971))\"\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"9\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> params\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> new\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> URLSearchParams\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> api_key:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"YOUR_API_KEY\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> tags:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name=New Mexico State Capitol\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> body\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"POLYGON((-109.0448 36.9971,-109.0489 31.3337,-108.2140 31.3349,-108.2071 31.7795,-106.5317 31.7830,-106.6223 32.0034,-103.0696 31.9999,-103.0023 36.9982,-109.0475 36.9982,-109.0448 36.9971))\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">;\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`https://osm.buntinglabs.com/v1/osm/count?\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">params\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">method:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'PUT'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">body\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> })\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> .\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">then\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">response\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> =>\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">())\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> .\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">then\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> =>\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">));\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"10\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">params \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"api_key\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"YOUR_API_KEY\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"tags\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"name=New Mexico State Capitol\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">data \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"POLYGON((-109.0448 36.9971,-109.0489 31.3337,-108.2140 31.3349,-108.2071 31.7795,-106.5317 31.7830,-106.6223 32.0034,-103.0696 31.9999,-103.0023 36.9982,-109.0475 36.9982,-109.0448 36.9971))\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.put(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://osm.buntinglabs.com/v1/osm/count\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">params\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">params, \u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">data)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(response.json())\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"feature_count\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"response_bytes\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">2342\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Count within Geometry","path":"/v1/osm/count","servers":[{"url":"https://osm.buntinglabs.com"}],"method":"put","request":{"security":[],"parameters":{"query":{"tags":{"schema":[{"type":"string","description":"All features counted will satisfy each of the passed tags given by this parameter. `tags` is formatted as a list of tags, each like `key=value` . You can create a tag list by forming an array of `key=value` items and joining them into one string with the `\u0026` character. This list must be URL encoded because both `=` and `\u0026` are reserved characters in URI. An example list of tags could be `leisure=park` and `name=Westglen Park` . This matches parks that have the name Westglen Park. To set this parameter, we’ll URL encode `leisure=park\u0026name=Westglen Park` . Documentation on tags can be found on the TagInfo resource website.","required":true,"placeholder":"leisure=park"}]},"api_key":{"schema":[{"type":"string","description":"Your account’s API key. You can create an API key by registering for an account and copy and paste it from your account dashboard .","required":true,"placeholder":"demo"}]}},"header":{},"cookie":{},"path":{}},"body":{}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"feature_count":[{"type":"number","description":"The number of features matching the filter tags and bounding box."}],"response_bytes":[{"type":"number","description":"The size of the GeoJSON response, in bytes, that one would get if the same query were used to extract features from OSM inside a polygon ."}],"error":[{"type":"string","description":"The error message if the extract request parameters were incorrectly formatted. This response field will not be present if the extract succeeds."}]}}],"examples":{"example":{"value":{"feature_count":123,"response_bytes":123,"error":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"buntinglabs","siteName":"Bunting Labs Docs","title":"Count within Geometry - Bunting Labs Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"openstreetmap-api/count-within-geometry.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"This endpoint searches for features matching tags inside an uploaded WKT geometry, then gives the total count and GeoJSON download size.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bunting Labs Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/buntinglabs/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/buntinglabs/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/buntinglabs/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/buntinglabs/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Count within Geometry - Bunting Labs Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"This endpoint searches for features matching tags inside an uploaded WKT geometry, then gives the total count and GeoJSON download size.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bunting Labs Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://buntinglabs.mintlify.site/_mintlify/api/og/v2?division=OpenStreetMap+API\u0026amp;title=Count+within+Geometry\u0026amp;description=This+endpoint+searches+for+features+matching+tags+inside+an+uploaded+WKT+geometry%2C+then+gives+the+total+count+and+GeoJSON+download+size.\u0026amp;theme=1017170a63c2abbadf1caba8\u0026amp;signature=7a0d63aebdcd536a00ba28df5ca0b6ccae1e3355a6ddece1cf02d2155580ee6a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Count within Geometry - Bunting Labs Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"This endpoint searches for features matching tags inside an uploaded WKT geometry, then gives the total count and GeoJSON download size.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://buntinglabs.mintlify.site/_mintlify/api/og/v2?division=OpenStreetMap+API\u0026amp;title=Count+within+Geometry\u0026amp;description=This+endpoint+searches+for+features+matching+tags+inside+an+uploaded+WKT+geometry%2C+then+gives+the+total+count+and+GeoJSON+download+size.\u0026amp;theme=1017170a63c2abbadf1caba8\u0026amp;signature=7a0d63aebdcd536a00ba28df5ca0b6ccae1e3355a6ddece1cf02d2155580ee6a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/buntinglabs/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bunting Labs Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#570DF8\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/openstreetmap-api/count-within-geometry.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.buntinglabs.com/#organization\",\"name\":\"Bunting Labs Docs\",\"url\":\"https://docs.buntinglabs.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintlify.s3.us-west-1.amazonaws.com/buntinglabs/logo/light.png\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.buntinglabs.com#website\",\"name\":\"Bunting Labs Docs\",\"url\":\"https://docs.buntinglabs.com\",\"publisher\":{\"@id\":\"https://docs.buntinglabs.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry#webpage\",\"url\":\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry\",\"name\":\"Count within Geometry\",\"description\":\"This endpoint searches for features matching tags inside an uploaded WKT geometry, then gives the total count and GeoJSON download size.\",\"isPartOf\":{\"@id\":\"https://docs.buntinglabs.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"OpenStreetMap API\",\"item\":\"https://docs.buntinglabs.com/openstreetmap-api/using-osm-data\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Count within Geometry\",\"item\":\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry#apireference\",\"headline\":\"Count within Geometry\",\"name\":\"Count within Geometry\",\"description\":\"This endpoint searches for features matching tags inside an uploaded WKT geometry, then gives the total count and GeoJSON download size.\",\"url\":\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry\",\"mainEntityOfPage\":{\"@id\":\"https://docs.buntinglabs.com/openstreetmap-api/count-within-geometry#webpage\"},\"publisher\":{\"@id\":\"https://docs.buntinglabs.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.buntinglabs.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bunting Labs Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Bunting Labs Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/openstreetmap-api/count-within-geometry.md","siteName":"Bunting Labs Docs","nav":{"global":null,"groups":[{"group":"Home","pages":[{"title":"Introduction","href":"/introduction"}]},{"group":"OpenStreetMap API","pages":[{"title":"Using OSM Data","href":"/openstreetmap-api/using-osm-data"},{"title":"Extract Features","api":"GET https://osm.buntinglabs.com/v1/osm/extract","href":"/openstreetmap-api/extract"},{"title":"Extract in Radius","api":"GET https://osm.buntinglabs.com/v1/osm/extract-in-radius","href":"/openstreetmap-api/extract-in-radius"},{"title":"Extract within Geometry","api":"PUT https://osm.buntinglabs.com/v1/osm/extract","href":"/openstreetmap-api/extract-within-geometry"},{"title":"Count Features","description":"This endpoint counts the features in OpenStreetMap that match the given tags and reside in a bounding box.","api":"GET https://osm.buntinglabs.com/v1/osm/count","href":"/openstreetmap-api/count"},{"title":"Count within Geometry","api":"PUT https://osm.buntinglabs.com/v1/osm/count","href":"/openstreetmap-api/count-within-geometry"},{"title":"Search Tags","description":"Search for OpenStreetMap tags (key and value combinations) by a query.","api":"GET https://osm.buntinglabs.com/v1/osm/tags","href":"/openstreetmap-api/search-tags"}]},{"group":"US Census API","pages":[{"title":"Population","api":"GET https://osm.buntinglabs.com/v1/census/population","href":"/census-api/population"},{"title":"Median Income","api":"GET https://osm.buntinglabs.com/v1/census/income","href":"/census-api/median-income"}]},{"group":"Points of Interest API","pages":[{"title":"Neighborhood Description","api":"POST https://osm.buntinglabs.com/v1/poi/neighborhood","href":"/poi-api/neighborhood"}]},{"group":"Data from Satellite Imagery","pages":[{"title":"Building Outlines","api":"GET https://osm.buntinglabs.com/v1/buildings/select","href":"/building-api/select-buildings"}]},{"group":"Coordinate Geometry API","pages":[{"title":"What is cogo","href":"/coordinate-geometry-api/what-is-cogo"},{"title":"Generate Metes","api":"POST https://osm.buntinglabs.com/v1/cogo/generate-metes","href":"/coordinate-geometry-api/generate-metes"},{"title":"Read metes","href":"/coordinate-geometry-api/read-metes"}]}]},"basePath":"","title":"Count within Geometry - Bunting Labs Docs","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-CybtLBIt.js","utils-BMLj2fvV.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-B6In562Y.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Dr8Mfhp9.js","snippetPresets-2rmQvMVl.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-WMqJYdZj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CJ-MlPHu.js","shallow-dY3TMRCk.js","getApiPlaygroundDisplay-v-1B2bKm.js","CodeSnippet-BDhiTB7U.js","CodeSnippets-D9hnzQcS.js","Page-C4GwDT3_.js","getPastedJson-Th2V45jI.js","icon-BQXch1W9.js","MethodPill-BCqUneP3.js","DuplicateIcon-Q_-bhurZ.js","createIcon-DUjLHRqp.js","DynamicMarkdown-B-f2cqXQ.js","SectionHeading-Da5NsV4v.js","axios-vUo_bRtp.js"]}